sifflet-2.3.0: Simple, visual, functional language for learning about recursion.

Safe HaskellNone
LanguageHaskell2010

Language.Sifflet.Export.ToScheme

Synopsis

Documentation

type Exporter = Functions -> FilePath -> IO () Source

The type of a function to export (user) functions to a file.

data SchemeOptions Source

Constructors

SchemeOptions 

Fields

defineWithLambda :: Bool

use explicit lambda in function definitions, (define f (lambda (a b) ...)

inl :: Int -> String Source

Newline and indent

sepLines2 :: [String] -> String Source

sepLines2 is like sepLines, but adds an extra n between each pair of lines so they are "double spaced."

functionsToSExprs :: SchemeOptions -> Functions -> [SExpr] Source

Convert Sifflet Functions to Scheme SExprs

functionsToPrettyScheme :: SchemeOptions -> Functions -> String Source

Convert Sifflet Functions to pretty Scheme

defToSExpr :: SchemeOptions -> FunctionDefTuple -> SExpr Source

Convert a FunctionDefTuple to a Scheme SExpr. Use the form (define (name . args) body) except when there are zero arguments, which becomes a Scheme constant rather than a function, use (define name expr).

exportScheme :: VPUI -> SchemeOptions -> Exporter Source

Export functions to a Scheme file.