Module type CCHashTrie.S
Signature
val empty : 'a tval is_empty : _ t -> boolval singleton : key -> 'a -> 'a tval add : key -> 'a -> 'a t -> 'a tval mem : key -> _ t -> boolval get : key -> 'a t -> 'a optionval get_exn : key -> 'a t -> 'a- raises Not_found
 if key not present.
val update : key -> f:('a option -> 'a option) -> 'a t -> 'a tupdate k ~f mcallsf (Some v)ifget k m = Some v,f Noneotherwise. Then, iffreturnsSome v'it bindsktov', iffreturnsNoneit removesk.
val add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a tadd_mut ~id k v mbehaves likeadd k v m, except it will mutate in place whenever possible. Changes done with anidmight affect all versions of the structure obtained with the sameid(but not other versions).- raises Transient.Frozen
 if
idis frozen.
val remove_mut : id:Transient.t -> key -> 'a t -> 'a tSame as
remove, but modifies in place whenever possible.- raises Transient.Frozen
 if
idis frozen.
val update_mut : id:Transient.t -> key -> f:('a option -> 'a option) -> 'a t -> 'a tSame as
updatebut with mutability.- raises Transient.Frozen
 if
idis frozen.
val cardinal : _ t -> intval choose : 'a t -> (key * 'a) optionval choose_exn : 'a t -> key * 'a- raises Not_found
 if not pair was found.
val iter : f:(key -> 'a -> unit) -> 'a t -> unitval fold : f:('b -> key -> 'a -> 'b) -> x:'b -> 'a t -> 'b
Conversions
val to_list : 'a t -> (key * 'a) listval add_list : 'a t -> (key * 'a) list -> 'a tval add_list_mut : id:Transient.t -> 'a t -> (key * 'a) list -> 'a t- raises Frozen
 if the ID is frozen.
val of_list : (key * 'a) list -> 'a tval add_seq : 'a t -> (key * 'a) sequence -> 'a tval add_seq_mut : id:Transient.t -> 'a t -> (key * 'a) sequence -> 'a t- raises Frozen
 if the ID is frozen.