Module Cache

module Cache: sig .. end
Cache / memoization structures.

type ('a, 'b) t 
The type of cache strucutres, with unbounded sizes.
val make : ('a -> 'b) -> ('a, 'b) t
make f returns an empty cache based on the function f.
val get : ('a, 'b) t -> 'a -> 'b
get c x returns the value associated with x, either cached in c from a previous execution, or by executing the function used at cache creation over x.
val size : ('a, 'b) t -> int
Returns the size of the passed cache.
val clear : ('a, 'b) t -> unit
Empties the passed cache.