Prelude.HashtblThis is Ocaml's standard Hashtbl with some additional functions.
include module type of struct include Stdlib.Hashtbl endval create : ?random:bool -> int -> ('a, 'b) tval clear : ('a, 'b) t -> unitval reset : ('a, 'b) t -> unitval add : ('a, 'b) t -> 'a -> 'b -> unitval find : ('a, 'b) t -> 'a -> 'bval find_opt : ('a, 'b) t -> 'a -> 'b optionval find_all : ('a, 'b) t -> 'a -> 'b listval mem : ('a, 'b) t -> 'a -> boolval remove : ('a, 'b) t -> 'a -> unitval replace : ('a, 'b) t -> 'a -> 'b -> unitval iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unitval filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unitval fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'cval length : ('a, 'b) t -> intval stats : ('a, 'b) t -> statisticsval to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.tval to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.tval to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.tval add_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitval replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitval of_seq : ('a * 'b) Stdlib.Seq.t -> ('a, 'b) t(of_list alist) is the hash table that's equivalent to the alist.
val to_list : ('a, 'b) t -> ('a * 'b) list(to_list ht) is the alist that's equivalent to the hash table.
Invariant:
(of_list xs |> to_list |> sort compare) = (sort compare xs)(adjoin vadd empty) returns a function (f ht k v) that adjoins v to a collection of values associated with key k in hash table ht.
See Map.Make.adjoin for a discussion and example.
(classify f vadd empty) is a classifying adjoiner.