dovetail-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Dovetail.Build

Synopsis

Documentation

data BuildError Source #

Constructors

UnableToParse (NonEmpty ParserError) 
UnableToCompile MultipleErrors 
InternalError 

Instances

Instances details
Show BuildError Source # 
Instance details

Defined in Dovetail.Build

buildSingleModule :: [ExternsFile] -> Text -> Either BuildError (Module Ann, ExternsFile) Source #

Parse and build a single PureScript module, returning the compiled CoreFn module.

buildSingleExpression Source #

Arguments

:: 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.

buildSingleExpressionWith Source #

Arguments

:: (Expr -> Expr)

A function which can be used to modify the parsed syntax tree before compilation

-> 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) 

buildSingleExpressionFromAST Source #

Arguments

:: 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.