package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Memoization code -- not re-entrant!

val general : ?hashable:'a Base.Hashtbl_intf.Hashable.t -> ?cache_size_bound:Base.Int.t -> ('a -> 'b) -> 'a -> 'b

Returns 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 nonpositive.

val unit : (Base.Unit.t -> 'a) -> Base.Unit.t -> 'a

efficient special case for argument type unit

OCaml

Innovation. Community. Security.