build-1.0: Build systems a la carte

Description

Monadic tasks, as used by Excel, Shake and other build systems. Dependencies of monadic tasks can only be discovered dynamically, i.e. during their execution.

Synopsis

Documentation

track :: forall m k v. Monad m => Task Monad k v -> (k -> m v) -> m (v, [(k, v)]) Source #

Execute a monadic task using an effectful fetch function k -> m v, tracking the dependencies.

trackPure :: Task Monad k v -> (k -> v) -> (v, [k]) Source #

Execute a monadic task on a pure store k -> v, tracking the dependencies.

isInput :: Tasks Monad k v -> k -> Bool Source #

Given a description of tasks, check if a key is input.

computePure :: Task Monad k v -> (k -> v) -> v Source #

Run a task with a pure lookup function.

compute :: Task Monad k v -> Store i k v -> v Source #

Run a task in a given store.

Convert a task with a total lookup function k -> m v into a task with a partial lookup function k -> m (Maybe v). This essentially lifts the task from the type of values v to Maybe v, where the result Nothing indicates that the task failed because of a missing dependency.
Convert a task with a total lookup function k -> m v into a task with a lookup function that can throw exceptions k -> m (Either e v). This essentially lifts the task from the type of values v to Either e v, where the result Left e indicates that the task failed because of a failed dependency lookup, and Right v yeilds the value otherwise.