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

Fay

Description

Main library entry point.

Synopsis

Documentation

module Fay.Config

data CompileState Source #

State of the compiler.

Constructors

CompileState 

Fields

Instances

Instances details
Show CompileState Source # 
Instance details

Defined in Fay.Types

MonadState CompileState Compile Source # 
Instance details

Defined in Fay.Types

data CompileResult Source #

Constructors

CompileResult 

Instances

Instances details
Show CompileResult Source # 
Instance details

Defined in Fay.Types.CompileResult

compileFile :: Config -> FilePath -> IO (Either CompileError String) Source #

Compile the given file.

compileFileWithState :: Config -> FilePath -> IO (Either CompileError (String, Maybe [Mapping], CompileState)) Source #

Compile a file returning the resulting internal state of the compiler. Don't use this directly, it's only exposed for the test suite.

compileFileWithResult :: Config -> FilePath -> IO (Either CompileError CompileResult) Source #

Compile a file returning additional generated metadata.

compileFromTo :: Config -> FilePath -> Maybe FilePath -> IO () Source #

Compile the given file and write the output to the given path, or if nothing given, stdout.

compileFromToAndGenerateHtml :: Config -> FilePath -> FilePath -> IO (Either CompileError String) Source #

Compile the given file and write to the output, also generates HTML and sourcemap files if configured.

toJsName :: String -> String Source #

Convert a Haskell filename to a JS filename.

toTsName :: String -> String Source #

Convert a Haskell filename to a TypeScript filename.

showCompileError :: CompileError -> String Source #

Print a compile error for human consumption.

readConfigRuntime :: Config -> IO String Source #

Get the JS runtime source. This will return the user supplied runtime if it exists.