Module Belt.HashMap

module HashMap: Belt_HashMap
Belt.HashMap The top level provides generic mutable hash map operations. It also has two specialized inner modules Belt.HashMap.Int and Belt.HashMap.String

module Int: Belt_HashMapInt
Specalized when key type is int, more efficient than the generic type
module String: Belt_HashMapString
Specalized when key type is string, more efficient than the generic type
type ('key, 'value, 'id) t 
The type of hash tables from type 'key to type 'value.
type ('a, 'id) id = ('a, 'id) Belt_Id.hashable 
val make : hintSize:int ->
id:('key, 'id) id -> ('key, 'value, 'id) t
val clear : ('key, 'value, 'id) t -> unit
Empty a hash table.
val isEmpty : ('a, 'b, 'c) t -> bool
val set : ('key, 'value, 'id) t -> 'key -> 'value -> unit
set tbl k v if k does not exist, add the binding k,v, otherwise, update the old value with the new v
val copy : ('key, 'value, 'id) t -> ('key, 'value, 'id) t
val get : ('key, 'value, 'id) t -> 'key -> 'value option
val has : ('key, 'value, 'id) t -> 'key -> bool
has tbl x checks if x is bound in tbl.
val remove : ('key, 'value, 'id) t -> 'key -> unit
val forEachU : ('key, 'value, 'id) t -> ('key -> 'value -> unit [@bs]) -> unit
val forEach : ('key, 'value, 'id) t -> ('key -> 'value -> unit) -> unit
forEach tbl f applies f to all bindings in table tbl. f receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to f.
val reduceU : ('key, 'value, 'id) t ->
'c -> ('c -> 'key -> 'value -> 'c [@bs]) -> 'c
val reduce : ('key, 'value, 'id) t ->
'c -> ('c -> 'key -> 'value -> 'c) -> 'c
reduce tbl init f computes (f kN dN ... (f k1 d1 init)...), where k1 ... kN are the keys of all bindings in tbl, and d1 ... dN are the associated values. Each binding is presented exactly once to f. The order in which the bindings are passed to f is unspecified. However, if the table contains several bindings for the same key, they are passed to f in reverse order of introduction, that is, the most recent binding is passed first.
val keepMapInPlaceU : ('key, 'value, 'id) t ->
('key -> 'value -> 'value option [@bs]) -> unit
val keepMapInPlace : ('key, 'value, 'id) t ->
('key -> 'value -> 'value option) -> unit
val size : ('a, 'b, 'c) t -> int
size tbl returns the number of bindings in tbl. It takes constant time.
val toArray : ('key, 'value, 'id) t -> ('key * 'value) array
val keysToArray : ('key, 'a, 'b) t -> 'key array
val valuesToArray : ('a, 'value, 'b) t -> 'value array
val fromArray : ('key * 'value) array ->
id:('key, 'id) id -> ('key, 'value, 'id) t
val mergeMany : ('key, 'value, 'id) t -> ('key * 'value) array -> unit
val getBucketHistogram : ('a, 'b, 'c) t -> int array
val logStats : ('a, 'b, 'c) t -> unit