build-1.0: Build systems a la carte

Safe HaskellNone
LanguageHaskell2010

Build.Rebuilder

Description

Rebuilders take care of deciding whether a key needs to be rebuild and running the corresponding task if need be.

Synopsis

Documentation

type Rebuilder c i k v = k -> v -> Task c k v -> Task (MonadState i) k v Source #

Given a key-value pair and the corresponding task, a rebuilder returns a new task that has access to the build information and can use it to skip rebuilding a key if it is up to date.

adaptRebuilder :: Rebuilder Monad i k v -> Rebuilder Applicative i k v Source #

Get an applicative rebuilder out of a monadic one.

perpetualRebuilder :: Rebuilder Monad () k v Source #

Always rebuilds the key.

modTimeRebuilder :: Ord k => Rebuilder Applicative (MakeInfo k) k v Source #

This rebuilder uses modification time to decide whether a key is dirty and needs to be rebuilt. Used by Make.

type MakeInfo k = (Time, Map k Time) Source #

dirtyBitRebuilder :: Rebuilder Monad (k -> Bool) k v Source #

If the key is dirty, rebuild it. Used by Excel.

dirtyBitRebuilderWithCleanUp :: Ord k => Rebuilder Monad (Set k) k v Source #

If the key is dirty, rebuild it and clear the dirty bit. Used by Excel.

approximateRebuilder :: (Ord k, Eq v) => Rebuilder Monad (ApproximationInfo k) k v Source #

This rebuilders uses approximate dependencies to decide whether a key needs to be rebuilt.

type ApproximateDependencies k = Map k [k] Source #

If there is an entry for a key, it is an conservative approximation of its dependencies. Otherwise, we have no reasonable approximation and assume the key is always dirty (e.g. it uses an INDIRECT reference).

type ApproximationInfo k = (Set k, ApproximateDependencies k) Source #

A set of dirty keys and information about dependencies.

vtRebuilder :: (Eq k, Hashable v) => Rebuilder Monad (VT k v) k v Source #

This rebuilder relies on verifying traces.

stRebuilder :: (Eq k, Hashable v) => Rebuilder Monad (Step, ST k v) k v Source #

This rebuilder relies on version/step traces.

ctRebuilder :: (Eq k, Hashable v) => Rebuilder Monad (CT k v) k v Source #

This rebuilder relies on constructive traces.

dctRebuilder :: (Eq k, Hashable v) => Rebuilder Monad (DCT k v) k v Source #

This rebuilder relies on deep constructive traces.