Generic caching library
memoize ~destruct ~expire f
memoizes the results of f
.
`Keep_one
: only keeps the last result around`Keep_all
: (the default value) never delete any values from the cache`Lru n
: keep n
values in the cache and them removes the least recently
usedReturns memoized version of any function with argument unit. In effect this builds a lazy value.
These modules implement memoization and give you access to the cache. This, for instance, enables you to flush it.
This enables you to implement your own caching strategy and store.
Generic caching is based on separating the replacement policie and the
store and tying them together with Make
.