purescript-0.7.0.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript

Description

The main compiler module

Synopsis

Documentation

data RebuildPolicy Source

Determines when to rebuild a module

Constructors

RebuildNever

Never rebuild this module

RebuildAlways

Always rebuild this module

data MakeActions m Source

Actions that require implementations when running in "make" mode.

Constructors

MakeActions 

Fields

getInputTimestamp :: ModuleName -> m (Either RebuildPolicy (Maybe UTCTime))

Get the timestamp for the input file(s) for a module. If there are multiple files (.purs and foreign files, for example) the timestamp should be for the most recently modified file.

getOutputTimestamp :: ModuleName -> m (Maybe UTCTime)

Get the timestamp for the output files for a module. This should be the timestamp for the oldest modified file, or Nothing if any of the required output files are missing.

readExterns :: ModuleName -> m (FilePath, String)

Read the externs file for a module as a string and also return the actual path for the file.

codegen :: Module Ann -> Environment -> SupplyVar -> Externs -> m ()

Run the code generator for the module and write any required output files.

progress :: String -> m ()

Respond to a progress update.

type SupplyVar = Integer Source

A value to be used in the Supply monad.

type Externs = String Source

Generated code for an externs file.

make :: forall m. (Functor m, Applicative m, Monad m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => MakeActions m -> [(Either RebuildPolicy FilePath, Module)] -> m Environment Source

Compiles in "make" mode, compiling each module separately to a js files and an externs file

If timestamps have not changed, the externs file can be used to provide the module's types without having to typecheck the module again.