Safe Haskell | None |
---|---|
Language | Haskell98 |
- data RebuildPolicy
- data ProgressMessage = CompilingModule ModuleName
- renderProgressMessage :: ProgressMessage -> String
- data MakeActions m = MakeActions {
- getInputTimestamp :: ModuleName -> m (Either RebuildPolicy (Maybe UTCTime))
- getOutputTimestamp :: ModuleName -> m (Maybe UTCTime)
- readExterns :: ModuleName -> m (FilePath, Externs)
- codegen :: Module Ann -> Environment -> Externs -> SupplyT m ()
- progress :: ProgressMessage -> m ()
- type Externs = String
- make :: forall m. (Functor m, Applicative m, Monad m, MonadBaseControl IO m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => MakeActions m -> [Module] -> m Environment
- newtype Make a = Make {}
- runMake :: Options -> Make a -> IO (Either MultipleErrors a, MultipleErrors)
- buildMakeActions :: FilePath -> Map ModuleName (Either RebuildPolicy FilePath) -> Map ModuleName FilePath -> Bool -> MakeActions Make
Make API
data RebuildPolicy Source
Determines when to rebuild a module
RebuildNever | Never rebuild this module |
RebuildAlways | Always rebuild this module |
data ProgressMessage Source
Progress messages from the make process
renderProgressMessage :: ProgressMessage -> String Source
Render a progress message
data MakeActions m Source
Actions that require implementations when running in "make" mode.
This type exists to make two things abstract:
- The particular backend being used (Javascript, C++11, etc.)
- The details of how files are read/written etc.
MakeActions | |
|
make :: forall m. (Functor m, Applicative m, Monad m, MonadBaseControl IO m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => MakeActions m -> [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.
Implementation of Make API using files on disk
A monad for running make actions
runMake :: Options -> Make a -> IO (Either MultipleErrors a, MultipleErrors) Source
Execute a Make
monad, returning either errors, or the result of the compile plus any warnings.
:: FilePath | the output directory |
-> Map ModuleName (Either RebuildPolicy FilePath) | a map between module names and paths to the file containing the PureScript module |
-> Map ModuleName FilePath | a map between module name and the file containing the foreign javascript for the module |
-> Bool | Generate a prefix comment? |
-> MakeActions Make |
A set of make actions that read and write modules from the given directory.