(** Operations related to lazy evalution. *) val cache : (unit -> 'a -> 'b) -> ('a -> 'b) * (unit -> unit) (** This function creates a cached version of a function and an update function that flushes the cached values. Example: # let (f, update) = Lazy2.cache (fun () -> let now = Unix.gettimeofday () in fun () -> now) val f : unit -> float = val update : unit -> unit = # f ();; - : float = 1131896309.87811 # f ();; - : float = 1131896309.87811 # update ();; - : unit = () # f ();; - : float = 1131896316.95683 *) val tablecache : ('a -> 'b) -> ('a -> 'b) * (unit -> unit) (** Similar to cache, but values are cached using a hash table and therefore uses the same equality predicate as Hashtbl. *)