status: stable
val empty : 'a t
val singleton : int ‑> 'a ‑> 'a t
val doubleton : int ‑> 'a ‑> int ‑> 'a ‑> 'a t
val mem : int ‑> _ t ‑> bool
val find : int ‑> 'a t ‑> 'a option
equal ~eq a b
checks whether a
and b
have the same set of pairs
(key, value), comparing values with eq
.
val iter : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val fold : (int ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val choose : 'a t ‑> (int * 'a) option
val merge : f:(int ‑> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t
merge ~f m1 m2
merges m1
and m2
together, calling f
once on every
key that occurs in at least one of m1
and m2
.
if f k binding = Some c
then k -> c
is part of the result,
else k
is not part of the result.
val of_list : (int * 'a) list ‑> 'a t
val to_list : 'a t ‑> (int * 'a) list
Helpers