Module Hashset (.ml)


module Hashset: sig .. end
Very simple module implementing a polymorphic unbounded sets. An encapsulated ('a, unit) Hashtbl.t is used for quickly answering to the membership problem.

val default_size : int
The default size of the hash used in the implementation
class ['a] hashset : ?size:int -> unit -> object .. end
type 'a t = 'a hashset 
The abstract type of an hashset.
val make : ?size:int -> unit -> 'a t
The hashset constructor.
val mem : 'a t -> 'a -> bool
The member predicate.
val add : 'a t -> 'a -> unit
Add a member to the hashset.
val remove : 'a t -> 'a -> unit
Remove a member from the hashset.
val of_list : 'a list -> 'a t
Make an hashset from a list.
val uniq : 'a list -> 'a list
val uniq : 'a list -> 'a list
Exploit an hashset for implementing the uniq function over lists.