Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Build.Store
Description
An abstract key/value store.
Synopsis
- data Hash a
- class Ord a => Hashable a where
- data Store i k v
- getValue :: k -> Store i k v -> v
- putValue :: Eq k => k -> v -> Store i k v -> Store i k v
- getHash :: Hashable v => k -> Store i k v -> Hash v
- getInfo :: Store i k v -> i
- putInfo :: i -> Store i k v -> Store i k v
- mapInfo :: (i -> j) -> Store i k v -> Store j k v
- initialise :: i -> (k -> v) -> Store i k v
Hashing
A Hash
is used for efficient tracking and sharing of build results. We
use newtype Hash a = Hash a
for prototyping.
class Ord a => Hashable a where Source #
Methods
Compute the hash of a given value. We typically assume cryptographic hashing, e.g. SHA256.
Store
An abstract datatype for a key/value store with build information of type i
.
getHash :: Hashable v => k -> Store i k v -> Hash v Source #
Read the hash of a key's value. In some cases may be implemented more
efficiently than hash . getValue k
.
initialise :: i -> (k -> v) -> Store i k v Source #
Initialise the store.