cake-0.4.2.0: A build-system library and driver

Safe HaskellNone

Cake.Core

Contents

Synopsis

Patterns and rules.

type Rule = P (Act ())Source

Rules map names of files to actions building them.

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

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

Produce a file, using the given action. The action should be independent of the context.

produce' :: FilePath -> Act () -> Act AnswerSource

Produce a file, using with the given action. The action should be independent of the context. BUT: no problem to produce the same file multiple times.

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

overwrote :: FilePath -> Act AnswerSource

File was modified by some command, but in a way that does not invalidate previous computations. (This is probably only useful for latex processing).

Low-level interface

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

Answer a question using the action given. The action must be independent of the context.

fileStamp :: MonadIO m => FilePath -> m AnswerSource

Return a stamp (hash) for a file

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

Run the action in only in a clobbered state

Re-exports

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

Is used within a monadic computation to begin exception processing.