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
- | UnsupportedWhereInAlt Alt
- | UnsupportedImport ImportDecl
- | UnsupportedQualStmt QualStmt
- | EmptyDoBlock
- | UnsupportedModuleSyntax Module
- | LetUnsupported
- | InvalidDoBlock
- | RecursiveDoUnsupported
- | Couldn'tFindImport ModuleName [FilePath]
- | FfiNeedsTypeSig Decl
- | FfiFormatBadChars String
- | FfiFormatNoSuchArg Int
- | FfiFormatIncompleteArg
- | FfiFormatInvalidJavaScript SrcLoc String String
- | UnableResolveUnqualified Name
- | UnableResolveQualified QName
- | UnableResolveCachedImport ModuleName
- newtype Compile a = Compile {
- unCompile :: RWST CompileReader () CompileState (ErrorT CompileError IO) a
- class (Parseable from, Printable to) => CompilesTo from to | from -> to where
- class Printable a where
- data Fay a
- data CompileReader = CompileReader {}
- data CompileConfig
- configDirectoryIncludes :: CompileConfig -> [FilePath]
- addConfigDirectoryInclude :: FilePath -> CompileConfig -> CompileConfig
- addConfigDirectoryIncludes :: [FilePath] -> CompileConfig -> CompileConfig
- configPackages :: CompileConfig -> [String]
- addConfigPackage :: String -> CompileConfig -> CompileConfig
- addConfigPackages :: [String] -> CompileConfig -> CompileConfig
- data CompileState = CompileState {
- stateExports :: [QName]
- stateExportsCache :: Map ModuleName [QName]
- stateModuleName :: ModuleName
- stateFilePath :: FilePath
- stateRecordTypes :: [(QName, [QName])]
- stateRecords :: [(QName, [QName])]
- stateFayToJs :: [JsStmt]
- stateJsToFay :: [JsStmt]
- stateImported :: [(ModuleName, FilePath)]
- stateNameDepth :: Integer
- stateLocalScope :: Set Name
- stateModuleScope :: ModuleScope
- defaultCompileState :: IO CompileState
- defaultCompileReader :: CompileConfig -> IO CompileReader
- faySourceDir :: IO FilePath
- data FundamentalType
- data PrintState = PrintState {}
- newtype Printer a = Printer {
- runPrinter :: State PrintState a
- data Mapping = Mapping {}
- data SerializeContext
Documentation
Statement type.
Expression type.
Literal value type.
A name of some kind.
data CompileError Source
Error type.
Compile monad.
Compile | |
|
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 CompileReader Source
data CompileConfig Source
Configuration of the compiler.
Show CompileConfig | |
Default CompileConfig | Default configuration. |
configPackages :: CompileConfig -> [String]Source
addConfigPackages :: [String] -> CompileConfig -> CompileConfigSource
data CompileState Source
State of the compiler.
CompileState | |
|
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.
Printer | |
|
Mapping | |
|