This module is used for defining new types of rules for Shake build systems. Most users will find the built-in set of rules sufficient.
- type ShakeValue a = (Show a, Typeable a, Eq a, Hashable a, Binary a, NFData a)
- class (ShakeValue key, ShakeValue value) => Rule key value where
- data EqualCost
- rule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()
- apply :: Rule key value => [key] -> Action [value]
- apply1 :: Rule key value => key -> Action value
- trackUse :: ShakeValue key => key -> Action ()
- trackChange :: ShakeValue key => key -> Action ()
- trackAllow :: ShakeValue key => (key -> Bool) -> Action ()
- defaultRule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()
Define an alias for the six type classes required for things involved in Shake
This alias is only available in GHC 7.4 and above, and requires the
To define your own values meeting the necessary constraints it is convenient to use the extensions
DeriveDataTypeable to write:
newtype MyType = MyType (String, Bool) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
Define a pair of types that can be used by Shake rules. To import all the type classes required see Development.Shake.Classes.
[Required] Retrieve the
value associated with a
key, if available.
As an example for filenames/timestamps, if the file exists you should return
the timestamp, but otherwise return
Nothing. For rules whose values are not
storedValue should return
[Optional] Equality check, with a notion of how expensive the check was.
An equality check and a cost.
The equality check was cheap.
The equality check was expensive, as the results are not trivially equal.
The values are not equal.
Track that a key has been used by the action preceeding it.
Track that a key has been changed by the action preceeding it.
Allow any matching key to violate the tracking rules.