package fix

  1. Overview
  2. Docs

Memoize offers a number of combinators that help construct possibly recursive memoizing functions, that is, functions that lazily record their input/output graph, so as to avoid repeated computation.

Make constructs a memoizer for a type key that is equipped with an implementation of imperative maps.

module Make (M : sig ... end) : sig ... end

ForOrderedType is a special case of Make where it suffices to pass an ordered type T as an argument. A reference to a persistent map is used to hold the memoization table.

module ForOrderedType (T : Map.OrderedType) : sig ... end

ForHashedType is a special case of Make where it suffices to pass a hashed type T as an argument. A hash table is used to hold the memoization table.

module ForHashedType (T : Hashtbl.HashedType) : sig ... end

ForType is a special case of Make where it suffices to pass an arbitrary type T as an argument. A hash table is used to hold the memoization table. OCaml's built-in generic equality and hash functions are used.

module ForType (T : sig ... end) : sig ... end

Memoizers for some common types.

module Char : sig ... end
module Int : sig ... end
module String : sig ... end
OCaml

Innovation. Community. Security.