Safe Haskell | Safe-Infered |
---|
The Haskell→Javascript compiler.
- compile :: CompilesTo from to => CompileConfig -> from -> IO (Either CompileError (to, CompileState))
- runCompile :: CompileState -> Compile a -> IO (Either CompileError (a, CompileState))
- compileViaStr :: (Show from, Show to, CompilesTo from to) => CompileConfig -> (from -> Compile to) -> String -> IO (Either CompileError (String, CompileState))
- compileForDocs :: Module -> Compile [JsStmt]
- compileToAst :: (Show from, Show to, CompilesTo from to) => CompileState -> (from -> Compile to) -> String -> IO (Either CompileError (to, CompileState))
- compileFromStr :: (Parseable a, MonadError CompileError m) => (a -> m a1) -> String -> m a1
- compileModule :: Module -> Compile [JsStmt]
- compileExp :: Exp -> Compile JsExp
- printCompile :: (Show from, Show to, CompilesTo from to) => CompileConfig -> (from -> Compile to) -> String -> IO ()
- printTestCompile :: String -> IO ()
- compileToplevelModule :: Module -> Compile [JsStmt]
- prettyPrintString :: String -> IO String
Documentation
compile :: CompilesTo from to => CompileConfig -> from -> IO (Either CompileError (to, CompileState))Source
Compile something that compiles to something else.
runCompile :: CompileState -> Compile a -> IO (Either CompileError (a, CompileState))Source
Run the compiler.
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.