package conduit

  1. Overview
  2. Docs

Module Conduit_trieSource

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

Sourcetype 'a t

Radix tree that maps string keys to 'a values

include Sexplib0.Sexpable.S1 with type 'a t := 'a t
Sourceval t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
Sourceval empty : 'a t

An empty tree

Sourceval insert : string -> 'a -> 'a t -> 'a t

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

Sourceval 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.

Sourceval fold : (string -> 'a -> 'b -> 'b) -> 'b -> 'a t -> 'b

fold f initial t folds f over all bindings in t

Sourceval is_prefix : string -> string -> bool

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

OCaml

Innovation. Community. Security.