Safe Haskell | None |
---|
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 Decl
- | 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 {
- unCompile :: RWST CompileReader CompileWriter CompileState (ErrorT CompileError (ModuleT (ModuleInfo Compile) IO)) a
- type CompileResult a = Either CompileError (a, CompileState, CompileWriter)
- type CompileModule a = ModuleT Symbols IO (CompileResult a)
- class Printable a where
- data Fay a
- data CompileReader = CompileReader {
- readerConfig :: CompileConfig
- readerCompileLit :: Literal -> Compile JsExp
- readerCompileDecls :: Bool -> [Decl] -> Compile [JsStmt]
- data CompileWriter = CompileWriter {
- writerCons :: [JsStmt]
- writerFayToJs :: [(String, JsExp)]
- writerJsToFay :: [(String, JsExp)]
- data CompileConfig = CompileConfig {
- configOptimize :: Bool
- configFlattenApps :: Bool
- configExportRuntime :: Bool
- configExportStdlib :: Bool
- configExportStdlibOnly :: Bool
- configDirectoryIncludes :: [(Maybe String, FilePath)]
- configPrettyPrint :: Bool
- configHtmlWrapper :: Bool
- configSourceMap :: Bool
- configHtmlJSLibs :: [FilePath]
- configLibrary :: Bool
- configWarn :: Bool
- configFilePath :: Maybe FilePath
- configTypecheck :: Bool
- configWall :: Bool
- configGClosure :: Bool
- configPackageConf :: Maybe FilePath
- configPackages :: [String]
- configBasePath :: Maybe FilePath
- configStrict :: [String]
- configTypecheckOnly :: Bool
- configRuntimePath :: Maybe FilePath
- 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 {}
- 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.
data CompileError Source
Error type.
Show CompileError | |
Error CompileError | |
MonadError CompileError Compile |
Compile monad.
Compile | |
|
Monad Compile | |
Functor Compile | |
Applicative Compile | |
MonadIO Compile | |
MonadModule Compile | |
MonadState CompileState Compile | |
MonadError CompileError Compile | |
MonadWriter CompileWriter Compile | |
MonadReader CompileReader Compile |
type CompileResult a = Either CompileError (a, CompileState, CompileWriter)Source
type CompileModule a = ModuleT Symbols IO (CompileResult a)Source
Print some value.
Printable String | Just write out strings. |
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 ModuleName | Print module 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 ModulePath | Print a module path. |
Printable [JsStmt] | Print a list of statements. |
Printable (Printer ()) | A printer is a printable. |
data CompileReader Source
Configuration and globals for the compiler.
CompileReader | |
|
MonadReader CompileReader Compile |
data CompileWriter Source
Things written out by the compiler.
CompileWriter | |
|
Show CompileWriter | |
Monoid CompileWriter | Simple concatenating instance. |
MonadWriter CompileWriter Compile |
data CompileConfig Source
Configuration of the compiler.
CompileConfig | |
|
Show CompileConfig | |
Default CompileConfig | Default configuration. |
data CompileState Source
State of the compiler.
CompileState | |
|
Show CompileState | |
MonadState CompileState Compile |
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.
data PrintState Source
The state of the pretty printer.
Default PrintState | Default state. |
MonadState PrintState Printer |
The printer monad.
Printer | |
|
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 -> ModulePathSource
Construct the complete ModulePath from a ModuleName.
mkModulePaths :: ModuleName a -> [ModulePath]Source
mkModulePathFromQName :: QName a -> ModulePathSource
Converting a QName to a ModulePath is only relevant for constructors since they can conflict with module names.