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

Safe HaskellNone

Language.Fay.Types

Description

All Fay types and instances.

Synopsis

Documentation

data JsLit Source

Literal value type.

Instances

Eq JsLit 
Show JsLit 
Printable JsLit

Print literals. These need some special encoding for JS-format literals. Could use the Text.JSON library.

data JsName Source

A name of some kind.

Instances

Eq JsName 
Show JsName 
Printable JsName

Print one of the kinds of names.

class (Parseable from, Printable to) => CompilesTo from to | from -> to whereSource

Just a convenience class to generalize the parsing/printing of various types of syntax.

Methods

compileTo :: from -> Compile toSource

class Printable a whereSource

Print some value.

Methods

printJS :: a -> Printer ()Source

Instances

Printable String 
Printable ModuleName

Print module name.

Printable SpecialCon

Print special constructors (tuples, list, etc.)

Printable QName

Print (and properly encode to JS) a qualified name.

Printable Name

Print (and properly encode) a name.

Printable JsLit

Print literals. These need some special encoding for JS-format literals. Could use the Text.JSON library.

Printable JsName

Print one of the kinds of names.

Printable JsExp

Print an expression.

Printable JsStmt

Print a single statement.

Printable [JsStmt]

Print a list of statements.

Printable (Printer ()) 

data Fay a Source

The JavaScript FFI interfacing monad.

Instances

Monad Fay 
Foreign a => Foreign (Fay a)

JS values are foreignable.

data CompileConfig Source

Configuration of the compiler.

Instances

Show CompileConfig 
Default CompileConfig

Default configuration.

defaultCompileState :: IO CompileStateSource

The default compiler state.

defaultCompileReader :: CompileConfig -> IO CompileReaderSource

The default compiler reader value.

data FundamentalType Source

These are the data types that are serializable directly to native JS data types. Strings, floating points and arrays. The others are: actions in the JS monad, which are thunks that shouldn't be forced when serialized but wrapped up as JS zero-arg functions, and unknown types can't be converted but should at least be forced.

data Mapping Source

Constructors

Mapping 

Instances