CCTrie.Make
type char_ = W.char_
type key = W.t
val empty : 'a t
val is_empty : _ t -> bool
longest_prefix k m
finds the longest prefix of k
that leads to at least one path in m
(it does not mean that the prefix is bound to a value.
Example: if m
has keys "abc0" and "abcd", then longest_prefix "abc2" m
will return "abc".
Update the binding for the given key. The function is given None
if the key is absent, or Some v
if key
is bound to v
; if it returns None
the key is removed, otherwise it returns Some y
and key
becomes bound to y
.
Fold on key/value bindings. Will use WORD.of_list
to rebuild keys.
Map values, giving both key and value. Will use WORD.of_list
to rebuild keys.
val fold_values : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
More efficient version of fold
, that doesn't keep keys.
val iter_values : ('a -> unit) -> 'a t -> unit
Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.
val size : _ t -> int
Number of bindings.
All bindings whose key is bigger or equal to the given key, in ascending order.