Safe Haskell | None |
---|---|
Language | Haskell98 |
All Fay types and instances.
- data JsStmt
- = JsVar JsName JsExp
- | JsIf JsExp [JsStmt] [JsStmt]
- | JsEarlyReturn JsExp
- | JsThrow JsExp
- | JsWhile JsExp [JsStmt]
- | JsUpdate JsName JsExp
- | JsSetProp JsName JsName JsExp
- | JsSetQName (Maybe SrcSpan) QName JsExp
- | JsSetModule ModulePath JsExp
- | JsSetConstructor QName JsExp
- | JsSetPropExtern JsName JsName JsExp
- | JsContinue
- | JsBlock [JsStmt]
- | JsExpStmt JsExp
- data JsExp
- = JsName JsName
- | JsRawExp String
- | JsSeq [JsExp]
- | JsFun (Maybe JsName) [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)]
- | JsLitObj [(Name, JsExp)]
- | JsUndefined
- | JsAnd JsExp JsExp
- | JsOr JsExp JsExp
- data JsLit
- data JsName
- = JsNameVar QName
- | JsThis
- | JsParametrizedType
- | JsThunk
- | JsForce
- | JsApply
- | JsParam Integer
- | JsTmp Integer
- | JsConstructor QName
- | JsBuiltIn Name
- | JsModuleName ModuleName
- data CompileError
- = Couldn'tFindImport ModuleName [FilePath]
- | EmptyDoBlock
- | FfiFormatBadChars SrcSpanInfo String
- | FfiFormatIncompleteArg SrcSpanInfo
- | FfiFormatInvalidJavaScript SrcSpanInfo String String
- | FfiFormatNoSuchArg SrcSpanInfo Int
- | FfiNeedsTypeSig Exp
- | GHCError String
- | InvalidDoBlock
- | ParseError SrcLoc String
- | ShouldBeDesugared String
- | UnableResolveQualified QName
- | UnsupportedDeclaration Decl
- | UnsupportedEnum Exp
- | UnsupportedExportSpec ExportSpec
- | UnsupportedExpression Exp
- | UnsupportedFieldPattern PatField
- | UnsupportedImport ImportDecl
- | UnsupportedLet
- | UnsupportedLetBinding Decl
- | UnsupportedLiteral Literal
- | UnsupportedModuleSyntax String Module
- | UnsupportedPattern Pat
- | UnsupportedQualStmt QualStmt
- | UnsupportedRecursiveDo
- | UnsupportedRhs Rhs
- | UnsupportedWhereInAlt Alt
- | UnsupportedWhereInMatch Match
- newtype Compile a = Compile {}
- type CompileModule a = ModuleT Symbols IO (Either CompileError (a, CompileState, CompileWriter))
- class Printable a where
- data Fay a
- data CompileReader = CompileReader {
- readerConfig :: Config
- readerCompileLit :: Literal -> Compile JsExp
- readerCompileDecls :: Bool -> [Decl] -> Compile [JsStmt]
- data CompileWriter = CompileWriter {
- writerCons :: [JsStmt]
- writerFayToJs :: [(String, JsExp)]
- writerJsToFay :: [(String, JsExp)]
- data Config
- data CompileState = CompileState {
- stateInterfaces :: Map ModuleName Symbols
- stateRecordTypes :: [(QName, [QName])]
- stateRecords :: [(QName, [Name])]
- stateNewtypes :: [(QName, Maybe QName, Type)]
- stateImported :: [(ModuleName, FilePath)]
- stateNameDepth :: Integer
- stateModuleName :: ModuleName
- stateJsModulePaths :: Set ModulePath
- stateUseFromString :: Bool
- stateTypeSigs :: Map QName Type
- data FundamentalType
- data PrintState = PrintState {}
- defaultPrintState :: PrintState
- newtype Printer a = Printer {
- runPrinter :: State PrintState a
- data SerializeContext
- data ModulePath
- mkModulePath :: ModuleName a -> ModulePath
- mkModulePaths :: ModuleName a -> [ModulePath]
- mkModulePathFromQName :: QName a -> ModulePath
Documentation
Statement type.
Expression type.
Literal value type.
A name of some kind.
JsNameVar QName | |
JsThis | |
JsParametrizedType | |
JsThunk | |
JsForce | |
JsApply | |
JsParam Integer | |
JsTmp Integer | |
JsConstructor QName | |
JsBuiltIn Name | |
JsModuleName ModuleName |
data CompileError Source
Error type.
Couldn'tFindImport ModuleName [FilePath] | |
EmptyDoBlock | |
FfiFormatBadChars SrcSpanInfo String | |
FfiFormatIncompleteArg SrcSpanInfo | |
FfiFormatInvalidJavaScript SrcSpanInfo String String | |
FfiFormatNoSuchArg SrcSpanInfo Int | |
FfiNeedsTypeSig Exp | |
GHCError String | |
InvalidDoBlock | |
ParseError SrcLoc String | |
ShouldBeDesugared String | |
UnableResolveQualified QName | |
UnsupportedDeclaration Decl | |
UnsupportedEnum Exp | |
UnsupportedExportSpec ExportSpec | |
UnsupportedExpression Exp | |
UnsupportedFieldPattern PatField | |
UnsupportedImport ImportDecl | |
UnsupportedLet | |
UnsupportedLetBinding Decl | |
UnsupportedLiteral Literal | |
UnsupportedModuleSyntax String Module | |
UnsupportedPattern Pat | |
UnsupportedQualStmt QualStmt | |
UnsupportedRecursiveDo | |
UnsupportedRhs Rhs | |
UnsupportedWhereInAlt Alt | |
UnsupportedWhereInMatch Match |
Compile monad.
Compile | |
|
type CompileModule a = ModuleT Symbols IO (Either CompileError (a, CompileState, CompileWriter)) Source
class Printable a where Source
Print some value.
Printable String | Just write out strings. |
Printable ModulePath | Print a module path. |
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 ()) | A printer is a printable. |
data CompileReader Source
Configuration and globals for the compiler.
CompileReader | |
|
data CompileWriter Source
Things written out by the compiler.
CompileWriter | |
|
Show CompileWriter | |
Monoid CompileWriter | Simple concatenating instance. |
MonadWriter CompileWriter Compile |
Configuration of the compiler. The fields with a leading underscore
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: 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.
defaultPrintState :: PrintState Source
Default state.
The printer monad.
Printer | |
|
Monad Printer | |
Functor Printer | |
Applicative Printer | |
MonadState PrintState Printer | |
Printable (Printer ()) | A printer is a printable. |
data SerializeContext Source
The serialization context indicates whether we're currently serializing some value or a particular field in a user-defined data type.
data ModulePath Source
The name of a module split into a list for code generation.
Eq ModulePath | |
Ord ModulePath | |
Show ModulePath | |
Printable ModulePath | Print a module path. |
mkModulePath :: ModuleName a -> ModulePath Source
Construct the complete ModulePath from a ModuleName.
mkModulePaths :: ModuleName a -> [ModulePath] Source
mkModulePathFromQName :: QName a -> ModulePath Source
Converting a QName to a ModulePath is only relevant for constructors since they can conflict with module names.