- type Build a = ErrorT BuildError (StateT BuildState IO) a
- runBuild :: FilePath -> Build a -> IO (Either BuildError a)
- runBuildWithState :: BuildState -> Build a -> IO (Maybe a)
- data BuildError
- throw :: BuildError -> Build a
- catch :: Build a -> (BuildError -> Build a) -> Build a
- needs :: FilePath -> Build ()
- io :: IO a -> Build a
- out :: Pretty a => a -> Build ()
- outLn :: Pretty a => a -> Build ()
The builder monad encapsulates and IO action that can fail with an error, and also read some global configuration info.
Run a build command. The first argument is a directory that can be used for temporary files (like "/tmp")
The errors we recognise.
Some generic error
Some system command fell over, and it barfed out the given stdout and stderr.
Some miscellanous IO action failed.
|forall prop . Show prop => ErrorCheckFailed Bool prop|
A build command needs the following file to continue. This can be used for writing make-like bots.
Run a build command, catching any exceptions it sends.
Throw a needs error saying we needs the given file. A catcher could then usefully create the file, or defer the compuation until it has been created.