val get : ('a, 'b) t ‑> 'a ‑> 'b option
val set : ('a, 'b) t ‑> 'a ‑> 'b ‑> unit
val with_cache : ('a, 'b) t ‑> ('a ‑> 'b) ‑> 'a ‑> 'b
with_cache c f
behaves like f
, but caches calls to f
in the
cache c
. It always returns the same value as
f x
, if f x
returns, or raise the same exception.
However, f
may not be called if x
is in the cache.
val size : (_, _) t ‑> int
Size of the cache (number of entries). At most linear in the number of entries.
val iter : ('a, 'b) t ‑> ('a ‑> 'b ‑> unit) ‑> unit
Iterate on cached values. Should yield size cache
pairs.