Safe Haskell | None |
---|
All Fay types and instances.
- data JsStmt
- data JsExp
- = JsName JsName
- | JsRawExp String
- | JsFun [JsParam] [JsStmt] (Maybe JsExp)
- | JsLit JsLit
- | JsApp JsExp [JsExp]
- | JsTernaryIf JsExp JsExp JsExp
- | JsNull
- | JsSequence [JsExp]
- | JsParen JsExp
- | JsGetProp JsExp JsName
- | JsLookup JsExp JsExp
- | JsUpdateProp JsExp JsName JsExp
- | JsGetPropExtern JsExp JsName
- | JsUpdatePropExtern JsExp JsName JsExp
- | JsList [JsExp]
- | JsNew JsName [JsExp]
- | JsThrowExp JsExp
- | JsInstanceOf JsExp JsName
- | JsIndex Int JsExp
- | JsEq JsExp JsExp
- | JsInfix String JsExp JsExp
- data JsLit
- type JsParam = JsName
- type JsName = QName
- data CompileError
- = ParseError SrcLoc String
- | UnsupportedDeclaration Decl
- | UnsupportedExportSpec ExportSpec
- | UnsupportedMatchSyntax Match
- | UnsupportedWhereInMatch Match
- | UnsupportedExpression Exp
- | UnsupportedLiteral Literal
- | UnsupportedLetBinding Decl
- | UnsupportedOperator QOp
- | UnsupportedPattern Pat
- | UnsupportedRhs Rhs
- | UnsupportedGuardedAlts GuardedAlts
- | EmptyDoBlock
- | UnsupportedModuleSyntax Module
- | LetUnsupported
- | InvalidDoBlock
- | RecursiveDoUnsupported
- | FfiNeedsTypeSig Decl
- | FfiFormatBadChars String
- | FfiFormatNoSuchArg Int
- | FfiFormatIncompleteArg
- | FfiFormatInvalidJavaScript String String
- newtype Compile a = Compile {
- unCompile :: StateT CompileState (ErrorT CompileError IO) a
- class (Parseable from, Printable to) => CompilesTo from to | from -> to where
- class Printable a where
- data Fay a
- data CompileConfig = CompileConfig {}
- data CompileState = CompileState {
- stateConfig :: CompileConfig
- stateExports :: [Name]
- stateExportAll :: Bool
- stateModuleName :: ModuleName
- stateRecords :: [(Name, [Name])]
- data FundamentalType
Documentation
Statement type.
Expression type.
Literal value type.
data CompileError Source
Error type.
Compile monad.
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.
Print some value.
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. |
The JavaScript FFI interfacing monad.
data CompileConfig Source
Configuration of the compiler.
Show CompileConfig | |
Default CompileConfig | Default configuration. |
data CompileState Source
State of the compiler.
CompileState | |
|
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: actiosn 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.