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

Safe HaskellNone

Language.Fay.Compiler

Description

The Haskell→Javascript compiler.

Synopsis

Documentation

compileViaStr :: (Show from, Show to, CompilesTo from to) => FilePath -> CompileConfig -> (from -> Compile to) -> String -> IO (Either CompileError (PrintState, CompileState))Source

Compile a Haskell source string to a JavaScript source string.

compileForDocs :: Module -> Compile [JsStmt]Source

Compile the given Fay code for the documentation. This is specialised because the documentation isn't really “real” compilation.

compileToAst :: (Show from, Show to, CompilesTo from to) => FilePath -> CompileReader -> CompileState -> (from -> Compile to) -> String -> IO (Either CompileError (to, CompileState))Source

Compile a Haskell source string to a JavaScript source string.

compileModule :: Module -> Compile [JsStmt]Source

Compile Haskell module.

compileExp :: Exp -> Compile JsExpSource

Compile Haskell expression.

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

Compile a declaration.

printCompile :: (Show from, Show to, CompilesTo from to) => CompileConfig -> (from -> Compile to) -> String -> IO ()Source

Compile the given input and print the output out prettily.

printTestCompile :: String -> IO ()Source

Compile a String of Fay and print it as beautified JavaScript.

compileToplevelModule :: Module -> Compile [JsStmt]Source

Compile the top-level Fay module.