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

Safe HaskellNone

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, CompileWriter))Source

Compile a Haskell source string to a JavaScript source string.

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

Compile a Haskell source string to a JavaScript source string.

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.

compileModuleFromFile :: FilePath -> Compile [JsStmt]Source

Read a file and compile.

compileModuleFromContents :: String -> Compile [JsStmt]Source

Compile a source string.

compileModuleFromName :: ModuleName -> Compile [JsStmt]Source

Lookup a module from include directories and compile.

compileModule :: FilePath -> String -> Compile [JsStmt]Source

Compile given the location and source string.

compileModuleFromAST :: Module -> Compile [JsStmt]Source

Compile a parse HSE module.

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

Parse some Fay code.