Module Cudd.Weakke

module Weakke: sig .. end


Original Weak module of OCaml distribution modified by Bertrand Jeannet with a Custom (polymorphic) module.

A weak hash table is a hashed set of values. Each value may magically disappear from the set when it is not used by the rest of the program any more. This is normally used to share data structures without inducing memory leaks. Weak hash tables are defined on values from a Hashtbl.HashedType module; the equal relation and hash function are taken from that module. We will say that v is an instance of x if equal x v is true.

The equal relation must be able to work on a shallow copy of the values and give the same result as with the values themselves.

type 'a t 
type 'a hashtbl = 'a t 
type 'a compare = {
   hash :'a -> int;
   equal :'a -> 'a -> bool;
}
val create : int -> 'a t
val clear : 'a t -> unit
val merge : 'a t -> 'a -> 'a
val merge_map : 'a t -> 'a -> ('a -> 'a) -> 'a
val add : 'a t -> 'a -> unit
val remove : 'a t -> 'a -> unit
val find : 'a t -> 'a -> 'a
val find_all : 'a t -> 'a -> 'a list
val mem : 'a t -> 'a -> bool
val iter : ('a -> 'b) -> 'a t -> unit
val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val count : 'a t -> int
val stats : 'a t -> int * int * int * int * int * int
val print : ?first:(unit, Format.formatter, unit) Pervasives.format ->
?sep:(unit, Format.formatter, unit) Pervasives.format ->
?last:(unit, Format.formatter, unit) Pervasives.format ->
(Format.formatter -> 'a -> unit) ->
Format.formatter -> 'a t -> unit
module type S = sig .. end
The output signature of the functor Weak.Make.
module Make: 
functor (H : Hashtbl.HashedType) -> S with type data = H.t
Functor building an implementation of the weak hash table structure.
module Compare: sig .. end