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

Safe HaskellNone

Language.Fay

Description

The Haskell→Javascript compiler.

Synopsis

Documentation

compile :: CompilesTo from to => CompileConfig -> from -> IO (Either CompileError (to, CompileState))Source

Compile something that compiles to something else.

compileViaStr :: (Show from, Show to, CompilesTo from to) => CompileConfig -> (from -> Compile to) -> String -> IO (Either CompileError (String, 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) => CompileState -> (from -> Compile to) -> String -> IO (Either CompileError (to, CompileState))Source

Compile a Haskell source string to a JavaScript source string.

compileFromStr :: (Parseable a, MonadError CompileError m) => (a -> m a1) -> String -> m a1Source

Compile from a string.

compileModule :: Module -> Compile [JsStmt]Source

Compile Haskell module.

compileExp :: Exp -> Compile JsExpSource

Compile Haskell expression.

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.

prettyPrintString :: String -> IO StringSource

Format a JS string using js-beautify, or return the JS as-is if js-beautify is unavailable.