Module CCTrie.String
val empty : 'a tval is_empty : _ t -> boolval add : key -> 'a -> 'a t -> 'a tAdd a binding to the trie (possibly erasing the previous one).
val find_exn : key -> 'a t -> 'aSame as
findbut can fail.- raises Not_found
if the key is not present.
val longest_prefix : key -> 'a t -> keylongest_prefix k mfinds the longest prefix ofkthat leads to at least one path inm(it does not mean that the prefix is bound to a value.Example: if
mhas keys "abc0" and "abcd", thenlongest_prefix "abc2" mwill return "abc".- since
- 0.17
val update : key -> ('a option -> 'a option) -> 'a t -> 'a tUpdate the binding for the given key. The function is given
Noneif the key is absent, orSome vifkeyis bound tov; if it returnsNonethe key is removed, otherwise it returnsSome yandkeybecomes bound toy.
val fold : ('b -> key -> 'a -> 'b) -> 'b -> 'a t -> 'bFold on key/value bindings. Will use
WORD.of_listto rebuild keys.
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b tMap values, giving both key and value. Will use
WORD.of_listto rebuild keys.- since
- 0.17
val fold_values : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bMore efficient version of
fold, that doesn't keep keys.
val iter_values : ('a -> unit) -> 'a t -> unitval merge : ('a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a tMerge two tries together. The function is used in case of conflicts, when a key belongs to both tries.
val size : _ t -> intNumber of bindings.