package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.file/B0_store/index.html
Module B0_store
Source
Lazy immutable stores.
These stores provide access to immutable, lazily determined, typed key-value bindings.
The value of a key in a store is defined either:
- Explicitly when the store is created.
- Lazily on the first key access via a key determination function specified at key creation time.
Once determined the value of a key in the store never changes.
Stores
The type for keys binding values of type 'a
.
The type for store bindings. A key and its value.
The type for stores.
make memo ~dir bs
is a store with predefined bindings bs
. If a key is mentioned more than once in bs
the last binding takes over. The store uses memo
to determine other keys as needed. dir
is a scratch directory used by key determination functions to write memoized file outputs.
dir s
is the scratch directory of s
. Key determination functions using this directory to write files should do so using nice file name prefixes (e.g. lowercased module or lib names) to avoid name clashes.
key ~mark det
is a new key whose value is determined on access by the future:
det s (Memo.with_mark mark (B0_store.memo s))
mark
defaults to ""
.
get s k
is a future that dermines with the value of k
in s
.