val empty : 'a t
val is_empty : _ t ‑> bool
update k ~f m
calls f (Some v)
if get k m = Some v
, f None
otherwise. Then, if f
returns Some v'
it binds k
to v'
,
if f
returns None
it removes k
.
val add_mut : id:Transient.t ‑> key ‑> 'a ‑> 'a t ‑> 'a t
add_mut ~id k v m
behaves like add k v m
, except it will mutate
in place whenever possible. Changes done with an id
might affect all
versions of the structure obtained with the same id
(but not
other versions).
id
is frozen.val remove_mut : id:Transient.t ‑> key ‑> 'a t ‑> 'a t
Same as remove, but modifies in place whenever possible.
id
is frozen.val update_mut : id:Transient.t ‑> key ‑> f:('a option ‑> 'a option) ‑> 'a t ‑> 'a t
Same as update but with mutability.
id
is frozen.val cardinal : _ t ‑> int
val add_list_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) list ‑> 'a t
val add_seq_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) sequence ‑> 'a t
val add_gen_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) gen ‑> 'a t