fay-0.24.2.0: A compiler for Fay, a Haskell subset that compiles to JavaScript.
Safe HaskellNone
LanguageHaskell2010

Fay.Compiler

Description

The Haskell→Javascript compiler.

Synopsis

Documentation

runCompileModule :: CompileReader -> CompileState -> Compile a -> CompileModule a Source #

Runs compilation for a single module.

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

Compile a Haskell source string to a JavaScript source string.

compileWith :: (Monoid a, Semigroup a) => FilePath -> (a -> Module -> Compile a) -> (FilePath -> String -> Compile a) -> (X -> Module -> IO (Either CompileError Module)) -> String -> Compile (a, CompileState, CompileWriter) Source #

Compile a module

compileExp :: Exp -> Compile JsExp Source #

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 ast Source #

Parse some Fay code.