Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data BuildError
- = UnableToParse (NonEmpty ParserError)
- | UnableToCompile MultipleErrors
- | InternalError
- renderBuildError :: BuildError -> String
- buildSingleModule :: [ExternsFile] -> Text -> Either BuildError (Module Ann, ExternsFile)
- buildSingleExpression :: Maybe ModuleName -> [ExternsFile] -> Text -> Either BuildError (Expr Ann, SourceType)
- buildSingleExpressionWith :: (Expr -> Expr) -> Maybe ModuleName -> [ExternsFile] -> Text -> Either BuildError (Expr Ann, SourceType)
- buildSingleExpressionFromAST :: Maybe ModuleName -> [ExternsFile] -> Expr -> Either BuildError (Expr Ann, SourceType)
- buildCoreFnOnly :: [ExternsFile] -> Module -> Either MultipleErrors ((Module Ann, ExternsFile), MultipleErrors)
Documentation
data BuildError Source #
UnableToParse (NonEmpty ParserError) | |
UnableToCompile MultipleErrors | |
InternalError |
Instances
Show BuildError Source # | |
Defined in Dovetail.Build showsPrec :: Int -> BuildError -> ShowS # show :: BuildError -> String # showList :: [BuildError] -> ShowS # |
renderBuildError :: BuildError -> String Source #
buildSingleModule :: [ExternsFile] -> Text -> Either BuildError (Module Ann, ExternsFile) Source #
Parse and build a single PureScript module, returning the compiled CoreFn module.
buildSingleExpression Source #
:: Maybe ModuleName | The name of the "default module" whose exports will be made available unqualified to the evaluated expression. |
-> [ExternsFile] | |
-> Text | |
-> Either BuildError (Expr Ann, SourceType) |
Parse and build a single PureScript expression, returning the compiled CoreFn
module. The expression will be used to create a placeholder module with the name
Main
, and a single expression named main
, with the specified content.
buildSingleExpressionFromAST Source #
:: Maybe ModuleName | The name of the "default module" whose exports will be made available unqualified to the evaluated expression. |
-> [ExternsFile] | |
-> Expr | |
-> Either BuildError (Expr Ann, SourceType) |
buildCoreFnOnly :: [ExternsFile] -> Module -> Either MultipleErrors ((Module Ann, ExternsFile), MultipleErrors) Source #
Compile a single Module
into a CoreFn module.
This function is based on the rebuildModule
function.
It is reproduced and modified here in order to make it simpler to build a single module without all of the additional capabilities and complexity of the upstream API.