Transition_handler.Core_extended_cacheGeneric caching library
val memoize :
?destruct:( 'b -> unit ) ->
?expire:[ `Lru of int | `Keep_all | `Keep_one ] ->
( 'a -> 'b ) ->
'a ->
'bmemoize ~destruct ~expire f memoizes the results of f.
Returns 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.
module Lru : sig ... endLeast recently used caching
module Keep_all : sig ... endFull caching (never flushes out values automatically )
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.
module type Strategy = sig ... endReplacement policy
module type Store = sig ... endCaching store
module type S = sig ... endThe output signature of the functor Cache.Make
module Strategy : sig ... endPredefined strategies
module Store : sig ... endPredefined stores
module Make
(Strat : Strategy)
(Store : Store) :
S with type 'a with_init_args = 'a Store.with_init_args Strat.with_init_args