package core_kernel

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

Non-re-entrant memoization.

val general : ?hashable:'a Hashtbl.Hashable.t -> ?cache_size_bound:Base.Int.t -> ('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 : (Base.Unit.t -> 'a) -> Base.Unit.t -> 'a

efficient special case for argument type unit

OCaml

Innovation. Community. Security.