Up

module Conduit_trie

: sig

Radix tree that can do longest-prefix searches on string keys

#
type 'a t

Radix tree that maps string keys to 'a values

#
val empty : 'a t

An empty tree

#
val insert : string -> 'a -> 'a t -> 'a t

insert key value tree returns a new tree with the mapping key to value

#
val longest_prefix : string -> 'a t -> 'a option

longest_prefix key tree finds the key k which shares the longest prefix with key and returns the associated value.

#
val fold : (string -> 'a -> 'b -> 'b) -> 'b -> 'a t -> 'b

fold f initial t folds f over all bindings in t

#
val is_prefix : string -> string -> bool

is_prefix a b returns true if a is a prefix of b

#
val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
#
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
end