Safe Haskell | None |
---|
All Fay types and instances.
- data JsStmt
- data JsExp
- = JsName JsName
- | JsRawExp String
- | JsFun [JsName] [JsStmt] (Maybe JsExp)
- | JsLit JsLit
- | JsApp JsExp [JsExp]
- | JsNegApp JsExp
- | JsTernaryIf JsExp JsExp JsExp
- | JsNull
- | JsParen JsExp
- | JsGetProp JsExp JsName
- | JsLookup JsExp JsExp
- | JsUpdateProp JsExp JsName JsExp
- | JsGetPropExtern JsExp String
- | JsUpdatePropExtern JsExp JsName JsExp
- | JsList [JsExp]
- | JsNew JsName [JsExp]
- | JsThrowExp JsExp
- | JsInstanceOf JsExp JsName
- | JsIndex Int JsExp
- | JsEq JsExp JsExp
- | JsNeq JsExp JsExp
- | JsInfix String JsExp JsExp
- | JsObj [(String, JsExp)]
- | JsUndefined
- data JsLit
- data JsName
- data CompileError
- = ParseError SrcLoc String
- | UnsupportedDeclaration Decl
- | UnsupportedExportSpec ExportSpec
- | UnsupportedMatchSyntax Match
- | UnsupportedWhereInMatch Match
- | UnsupportedExpression Exp
- | UnsupportedLiteral Literal
- | UnsupportedLetBinding Decl
- | UnsupportedOperator QOp
- | UnsupportedPattern Pat
- | UnsupportedFieldPattern PatField
- | UnsupportedRhs Rhs
- | UnsupportedGuardedAlts GuardedAlts
- | UnsupportedImport ImportDecl
- | UnsupportedQualStmt QualStmt
- | EmptyDoBlock
- | UnsupportedModuleSyntax Module
- | LetUnsupported
- | InvalidDoBlock
- | RecursiveDoUnsupported
- | Couldn'tFindImport ModuleName [FilePath]
- | FfiNeedsTypeSig Decl
- | FfiFormatBadChars String
- | FfiFormatNoSuchArg Int
- | FfiFormatIncompleteArg
- | FfiFormatInvalidJavaScript String String
- | UnableResolveUnqualified Name
- | UnableResolveQualified QName
- 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 {
- configOptimize :: Bool
- configFlattenApps :: Bool
- configExportBuiltins :: Bool
- configDirectoryIncludes :: [FilePath]
- configPrettyPrint :: Bool
- configHtmlWrapper :: Bool
- configHtmlJSLibs :: [FilePath]
- configLibrary :: Bool
- configWarn :: Bool
- configFilePath :: Maybe FilePath
- configTypecheck :: Bool
- configWall :: Bool
- data CompileState = CompileState {
- stateConfig :: CompileConfig
- stateExports :: [QName]
- stateExportAll :: Bool
- stateModuleName :: ModuleName
- stateFilePath :: FilePath
- stateRecords :: [(QName, [QName])]
- stateFayToJs :: [JsStmt]
- stateJsToFay :: [JsStmt]
- stateImported :: [(ModuleName, FilePath)]
- stateNameDepth :: Integer
- stateScope :: Map Name [NameScope]
- defaultCompileState :: CompileConfig -> IO CompileState
- data FundamentalType
- data PrintState = PrintState {}
- newtype Printer a = Printer {
- runPrinter :: State PrintState a
- data NameScope
- data Mapping = Mapping {}
Documentation
Statement type.
Expression type.
Literal value type.
A name of some kind.
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 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 ()) |
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 | |
|
defaultCompileState :: CompileConfig -> IO CompileStateSource
The default compiler state.
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.
Printer | |
|
A name's scope, either imported or bound locally.