| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | github.com/justinethier |
| Safe Haskell | None |
Language.Scheme.Compiler.Types
Description
This module contains data types used by the compiler.
- data CompOpts = CompileOptions {
- coptsThisFunc :: String
- coptsThisFuncUseValue :: Bool
- coptsThisFuncUseArgs :: Bool
- coptsNextFunc :: Maybe String
- data CompLibOpts = CompileLibraryOptions {
- compBlock :: String -> Maybe String -> Env -> [HaskAST] -> [LispVal] -> IOThrowsError [HaskAST]
- compLisp :: Env -> String -> String -> Maybe String -> IOThrowsError [HaskAST]
- defaultCompileOptions :: String -> CompOpts
- data HaskAST
- = AstAssignM String HaskAST
- | AstFunction { }
- | AstValue String
- | AstContinuation { }
- ast2Str :: LispVal -> String
- asts2Str :: [LispVal] -> String
- createAstFunc :: CompOpts -> [HaskAST] -> HaskAST
- createAstCont :: CompOpts -> String -> String -> HaskAST
- joinL :: forall a. [[a]] -> [a] -> [a]
- moduleRuntimeVar :: [Char]
- showValAST :: HaskAST -> String
- header :: String -> Bool -> String -> [String]
- headerComment :: [String]
- headerModule :: [String]
- headerImports :: [String]
Data types
data CompOpts
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
| |
data CompLibOpts
Options passed to the compiler library module
Constructors
| CompileLibraryOptions | |
Fields
| |
defaultCompileOptions :: String -> CompOpts
The default compiler options
data HaskAST
A very basic type to store a Haskell AST.
Constructors
| AstAssignM String HaskAST | |
| AstFunction | |
| AstValue String | |
| AstContinuation | |
Instances
| Show HaskAST |
Utility functions
Arguments
| :: CompOpts | Compilation options |
| -> [HaskAST] | Body of the function |
| -> HaskAST | Complete function code |
Create code for a function
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
Arguments
| :: forall a . | |
| => [[a]] | Original list-of-lists |
| -> [a] | Separator |
| -> [a] | Joined list |
A utility function to join list members together
moduleRuntimeVar :: [Char]
Runtime reference to module data structure
showValAST :: HaskAST -> String
Generate code based on the given Haskell AST
Headers appended to output file
header :: String -> Bool -> String -> [String]
Block of code used in the header of a Haskell program generated by the compiler.
headerComment :: [String]
Header comment used at the top of a Haskell program generated by the compiler
headerModule :: [String]
Main module used in a compiled Haskell program
headerImports :: [String]
Imports used for a compiled program