Module Core_extended.Std.Memo

include Core.Memo

Non-re-entrant memoization.

val general : ?⁠hashable:'a Core_kernel.Hashtbl.Hashable.t ‑> ?⁠cache_size_bound:Core_kernel__.Import.int ‑> ('a ‑> 'b) ‑> 'a ‑> 'b

Returns a memoized version of any function with a single argument. The default caching policy is to remember everything for the lifetime of the returned closure, but one may specify an upper bound on cache size. Whenever a cache entry must be forgotten in order to obey this bound, we pick the least-recently-used one.

Raises an exception if cache_size_bound is negative or zero.

val unit : (Core_kernel__.Import.unit ‑> 'a) ‑> Core_kernel__.Import.unit ‑> 'a

efficient special case for argument type unit

include Extended_memo

Extensio to Core.Memo

val general_rec : (('a ‑> 'b) ‑> 'a ‑> 'b) ‑> 'a ‑> 'b

A version of Memo.general more suitable for memoizing recursively-defined functions

val reentrant_unit : (unit ‑> 'a) ‑> unit ‑> 'a