cake-0.3.2.1: 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 with 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.

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 should be independent of the context.

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

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.

data Answer Source

Constructors

Stamp (Maybe MD5Digest) 
Text [String] 

Re-exports