Portability | portable |
---|---|
Stability | experimental |
Maintainer | github.com/justinethier |
Safe Haskell | None |
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
- | AstRef String
- | AstContinuation { }
- ast2Str :: LispVal -> String
- asts2Str :: [LispVal] -> String
- createAstFunc :: CompOpts -> [HaskAST] -> HaskAST
- createAstCont :: CompOpts -> String -> String -> HaskAST
- joinL :: forall a. [[a]] -> [a] -> [a]
- moduleRuntimeVar :: String
- 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.
CompileOptions | |
|
data CompLibOpts
Options passed to the compiler library module
CompileLibraryOptions | |
|
defaultCompileOptions :: String -> CompOpts
The default compiler options
data HaskAST
A very basic type to store a Haskell AST.
AstAssignM String HaskAST | |
AstFunction | |
AstValue String | |
AstRef String | |
AstContinuation | |
Show HaskAST |
Utility functions
Create code for a function
:: 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
:: forall a . | |
=> [[a]] | Original list-of-lists |
-> [a] | Separator |
-> [a] | Joined list |
A utility function to join list members together
moduleRuntimeVar :: String
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