cake-1.0.0: A build-system library and driver

Safe HaskellNone




Patterns and rules.

type Rule = P (Act ())Source

Rules map names of files to actions building them.

(==>) :: P x -> (x -> Act a) -> RuleSource

Primitve for rule construction. The given action must produce files matched by the pattern.

High-level interface

cake :: Rule -> Act () -> IO ()Source

Run an action in the context of a set of rules.

need :: FilePath -> Act ()Source

Try to build a file using known rules; then mark it as used.

list :: FilePath -> [Char] -> Act [String]Source

List directory contents by extension

Mid-level interface

produce :: FilePath -> Act () -> Act ()Source

produces :: [FilePath] -> Act () -> Act ()Source

Produce a file, using the given action.

cut :: Act () -> Act ()Source

Run the action in only in a clobbered state

Low-level interface

distill :: Question -> Act Answer -> Act AnswerSource

Answer a question using the action given.

fileStamp :: FilePath -> Act AnswerSource

Return a stamp (hash) for a file

shielded :: Act a -> Act aSource

Run the argument in a clean context, and do not clobber the state even if the argument does that. To use when the construction of the argument actually does not depend on the previous questions asked, and the constructed thing is atomic for the environment.

use :: FilePath -> Act AnswerSource

Mark that a file is used. Do not chase dependencies on this file though. (To be used eg. if a command uses an optional file).

updates :: [FilePath] -> Act () -> Act ()Source

Produce a file, using with the given action. BUT: no problem to produce the same file multiple times.


throwError :: MonadError e m => forall a. e -> m a

Is used within a monadic computation to begin exception processing.