-module type Abstract =
- sig
- type data
- (** The type of the data to be hashconsed *)
-
- type t
- (** The type of hashconsed data *)
-
- val make : data -> t
- (** [make v] internalizes the value [v], making it an hashconsed
- value.
- *)
-
- val node : t -> data
- (** [node h] extract the original data from its hashconsed value
- *)
-
- val hash : t -> int
- (** [hash h] returns a hash of [h], such that for every [h1] and
- [h2], [equal h1 h2] implies [hash h1 = hash h2].
- *)
-
- val uid : t -> Uid.t
- (** [uid h] returns a unique identifier *)
- val equal : t -> t -> bool
- (** Equality between hashconsed values. Equivalent to [==] *)
-
- val init : unit -> unit
- (** Initializes the internal storage. Any previously hashconsed
- element is discarded. *)
-
- end
-(** Abstract signature of a module implementing an hashconsed datatype *)
-
-module type S =
-sig
- type data
- type t = private { id : Uid.t;
- key : int;
- node : data }
- include Abstract with type data := data and type t := t
-end