husk-scheme-3.20: R5RS Scheme interpreter, compiler, and library.
CopyrightJustin Ethier
LicenseMIT (see LICENSE in the distribution)
Maintainergithub.com/justinethier
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Language.Scheme.Compiler.Types

Description

This module contains data types used by the compiler.

Synopsis

Data types

data CompOpts Source #

A type to store options passed to compile. Eventually all of this might be able to be integrated into a Compile monad.

Constructors

CompileOptions 

Fields

  • coptsThisFunc :: String

    Immediate name to use when creating a compiled function. Presumably there is other code that is expecting to call into it.

  • coptsThisFuncUseValue :: Bool

    Whether to include the value parameter in the current function

  • coptsThisFuncUseArgs :: Bool

    Whether to include the args parameter in the current function

  • coptsNextFunc :: Maybe String

    The name to use for the next function after the current compiler recursion is finished. For example, after compiling a block of code, the control flow would be expected to go to this function.

data CompLibOpts Source #

Options passed to the compiler library module

defaultCompileOptions :: String -> CompOpts Source #

The default compiler options

data HaskAST Source #

A very basic type to store a Haskell AST.

Instances

Instances details
Show HaskAST Source # 
Instance details

Defined in Language.Scheme.Compiler.Types

Utility functions

ast2Str :: LispVal -> String Source #

Convert abstract syntax tree to a string

asts2Str :: [LispVal] -> String Source #

Convert a list of abstract syntax trees to a list of strings

createAstFunc Source #

Arguments

:: CompOpts

Compilation options

-> [HaskAST]

Body of the function

-> HaskAST

Complete function code

Create code for a function

createAstCont Source #

Arguments

:: CompOpts

Compilation options

-> String

Value to send to the continuation

-> String

Extra leading indentation (or blank string if none)

-> HaskAST

Generated code

Create code for a continutation

joinL Source #

Arguments

:: forall a. [[a]]

Original list-of-lists

-> [a]

Separator

-> [a]

Joined list

A utility function to join list members together

moduleRuntimeVar :: String Source #

Runtime reference to module data structure

showValAST :: HaskAST -> String Source #

Generate code based on the given Haskell AST

Headers appended to output file

header :: String -> Bool -> String -> [String] Source #

Block of code used in the header of a Haskell program generated by the compiler.

headerComment :: [String] Source #

Header comment used at the top of a Haskell program generated by the compiler

headerModule :: [String] Source #

Main module used in a compiled Haskell program

headerImports :: [String] Source #

Imports used for a compiled program