Skip to content

Instantly share code, notes, and snippets.

@paolino
Created March 31, 2011 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paolino/896349 to your computer and use it in GitHub Desktop.
Save paolino/896349 to your computer and use it in GitHub Desktop.
-- | Pure item Selector
type Mask a = a -> Bool
-- | Build record, containing an action to build an item, and the dependencies.
--
-- The return value of the action computed in its monad is a set of created resources,
-- along with their compiler.
--
-- This derived resources depends on the up to date state of the builded one for their existence.
--
-- This is a different dependency from a uptodate to uptodate dependency.
--
-- The u2udeps are the normal uptodate to uptodate dependency, for the compiler. They functionally don't
-- on the item actually compiled.
--
data Build m a = Build {
buildAction :: a -> m [(a,Build m a)],
u2udeps :: Mask a
}
-- | Base set of builds, selectable by mask.
--
-- Notice how this is different from the structure returned from a Build action.
-- Here the actions are valid for a subspace of the items.
--
-- Any item matched by the 'Mask' must be compiled with the associated 'Build' value.
--
type Builder m a = [(Mask a, Build m a)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment