fay-0.1.1.0: 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 JsStmt Source

Statement type.

Instances

Eq JsStmt 
Show JsStmt 
Printable JsStmt

Print a single statement.

CompilesTo Module [JsStmt] 
CompilesTo Decl [JsStmt] 
Printable [JsStmt]

Print a list of statements.

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.

type JsParam = JsNameSource

Convenience type for function parameters.

type JsName = QNameSource

To be used to force name sanitization eventually.

type Compile = ReaderT Config (ErrorT CompileError IO)Source

Convenience/doc type.

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 -> StringSource

Instances

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 JsExp

Print an expression.

Printable JsStmt

Print a single statement.

Printable [JsStmt]

Print a list of statements.

data Fay a Source

The JavaScript FFI interfacing monad.

Instances

Monad Fay 
Foreign a => Foreign (Fay a)

JS values are foreignable.

data Config Source

Constructors

Config