fay-0.18.1.1: A compiler for Fay, a Haskell subset that compiles to JavaScript.

Safe HaskellNone

Fay.Compiler

Description

The Haskell→Javascript compiler.

Synopsis

Documentation

runCompileModule :: CompileReader -> CompileState -> Compile a -> CompileModule aSource

Runs compilation for a single module.

compileViaStr :: FilePath -> CompileConfig -> PrintState -> (Module -> Compile [JsStmt]) -> String -> IO (Either CompileError (PrintState, CompileState, CompileWriter))Source

Compile a Haskell source string to a JavaScript source string.

compileWith :: Monoid a => FilePath -> (a -> Module -> Compile a) -> (FilePath -> String -> Compile a) -> String -> Compile (a, CompileState, CompileWriter)Source

Compile a module

compileExp :: Exp -> Compile JsExpSource

Compile Haskell expression.

compileDecl :: Bool -> Decl -> Compile [JsStmt]Source

Compile a declaration.

compileToplevelModule :: FilePath -> Module -> Compile [JsStmt]Source

Compile the top-level Fay module.

compileModuleFromContents :: String -> Compile ([JsStmt], [JsStmt])Source

Compile a source string.

compileModuleFromAST :: ([JsStmt], [JsStmt]) -> Module -> Compile ([JsStmt], [JsStmt])Source

Compile a parse HSE module.

parseFay :: Parseable ast => FilePath -> String -> ParseResult astSource

Parse some Fay code.