(***********************************************************************) (* *) (* TAToo *) (* *) (* Kim Nguyen, LRI UMR8623 *) (* Université Paris-Sud & CNRS *) (* *) (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *) (* Recherche Scientifique. All rights reserved. This file is *) (* distributed under the terms of the GNU Lesser General Public *) (* License, with the special exception on linking described in file *) (* ../LICENSE. *) (* *) (***********************************************************************) (* Time-stamp: *) (** Implementation of generic hashconsing. *) include module type of Hcons_sig (** Output signature of the functor {!Hcons.Make} *) module Make (H : Common_sig.HashedType) : S with type data = H.t (** Functor building an implementation of hashconsed values for a given implementation of {!Common_sig.HashedType}. Hashconsed values are persistent: the are kept in memory even if no external reference remain. Calling [init()] explicitely will reclaim the space. *) module Weak (H : Common_sig.HashedType) : S with type data = H.t (** Functor building an implementation of hashconsed values for a given implementation of {!Common_sig.HashedType}. Hashconsed values have a weak semantics: they may be reclaimed as soon as no external reference to them exists. The space may still be reclaimed explicitely by calling [init]. *) module PosInt : Abstract with type data = int and type t = int (** Compact implementation of hashconsed positive integer that avoids boxing. [PosInt.make v] raises [Invalid_argument] if [ v < 0 ] *)