Content-addressable stores are store where it is possible to read and add new values. Keys are derived from the values raw contents and hence are deterministic.
The type for content-addressable backend stores. The
'a phantom type carries information about the store mutability.
type key = Val.hash
The type for keys.
find t k is
Some v if
k is associated to
k is not present in
Write the contents of a value to the store. It's the responsibility of the content-addressable store to generate a consistent key.
merge t lifts the merge functions defined on contents values to contents key. The merge function will: (i) read the values associated with the given keys, (ii) use the merge function defined on values and (iii) write the resulting values into the store to get the resulting key. See
If any of these operations fail, return
module Key : sig ... end
Key provides base functions for user-defined contents keys.
module Val : sig ... end
Val provides base functions for user-defined contents values.