husk-scheme-3.14: R5RS Scheme interpreter, compiler, and library.

Portabilityportable
Stabilityexperimental
Maintainergithub.com/justinethier
Safe HaskellNone

Language.Scheme.Compiler.Types

Contents

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.

data CompLibOpts Source

Options passed to the compiler library module

defaultCompileOptions :: String -> CompOptsSource

The default compiler options

data HaskAST Source

A very basic type to store a Haskell AST.

Instances

Utility functions

ast2Str :: LispVal -> StringSource

Convert abstract syntax tree to a string

asts2Str :: [LispVal] -> StringSource

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

createAstFuncSource

Arguments

:: CompOpts

Compilation options

-> [HaskAST]

Body of the function

-> HaskAST

Complete function code

Create code for a function

createAstContSource

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

joinLSource

Arguments

:: forall a .  
=> [[a]]

Original list-of-lists

-> [a]

Separator

-> [a]

Joined list

A utility function to join list members together

moduleRuntimeVar :: [Char]Source

Runtime reference to module data structure

showValAST :: HaskAST -> StringSource

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