package spotlib

  1. Overview
  2. Docs

Poorman's hashset by Hashtbl

type 'a t
val create : ?random:bool -> int -> 'a t
val add : 'a t -> 'a -> unit
val remove : 'a t -> 'a -> unit
val mem : 'a t -> 'a -> bool
val find : 'a t -> 'a -> 'a
val find_opt : 'a t -> 'a -> 'a option

find and find_opt finds the 'same' element in the set. Good for hash consing

val find_or_add : 'a t -> 'a -> 'a
val iter : ('a -> unit) -> 'a t -> unit
val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val elements : 'a t -> int
val clear : 'a t -> unit
val of_list : int -> 'a list -> 'a t
val to_list : 'a t -> 'a list
module Make (A : Hashtbl.HashedType) : sig ... end
OCaml

Innovation. Community. Security.