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

Safe HaskellSafe-Infered

Language.Fay.Compiler

Synopsis

Documentation

class Writer a whereSource

A result of something the compiler writes.

Methods

writeout :: a -> String -> IO ()Source

Instances

Writer FilePath

Simple file writer.

class Reader a whereSource

Something to feed into the compiler.

Methods

readin :: a -> IO StringSource

Instances

Reader FilePath

Simple file reader.

compileFromTo :: CompileConfig -> FilePath -> FilePath -> IO ()Source

Compile file program to…

compileReadWrite :: (Reader r, Writer w) => CompileConfig -> r -> w -> IO ()Source

Compile readable/writable values.

compileFile :: Reader r => CompileConfig -> r -> IO (Either CompileError String)Source

Compile the given file.

compileProgram :: (Show from, Show to, CompilesTo from to) => CompileConfig -> String -> (from -> Compile to) -> String -> IO (Either CompileError String)Source

Compile the given module to a runnable program.

printExport :: Name -> StringSource

Print an this.x = x; export out.

toJsName :: String -> StringSource

Convert a Haskell filename to a JS filename.