Legend:
Library
Module
Module type
Parameter
Class
Class type
Prefix trie interface.
Trie is a mutable table, that can be seen as a specialized form of a hash table.
Use Trie.Make functor to create modules, implementing this signature. Also look at already predefined modules, like String (see below), Bitvector.Trie, Bil.Trie, Insn.Trie, etc.
type'a t
trie can store arbitrary data
includesig ... end
val t_of_sexp : (Sexplib.Sexp.t ->'a)->Sexplib.Sexp.t ->'at
val sexp_of_t : ('a->Sexplib.Sexp.t)->'at->Sexplib.Sexp.t
val bin_t :
'aCore_kernel.Std.Bin_prot.Type_class.t->'atCore_kernel.Std.Bin_prot.Type_class.t
val bin_read_t :
'aCore_kernel.Std.Bin_prot.Read.reader->'atCore_kernel.Std.Bin_prot.Read.reader
val __bin_read_t__ :
'aCore_kernel.Std.Bin_prot.Read.reader->(int ->'at)Core_kernel.Std.Bin_prot.Read.reader
val bin_reader_t :
'aCore_kernel.Std.Bin_prot.Type_class.reader->'atCore_kernel.Std.Bin_prot.Type_class.reader
val bin_size_t :
'aCore_kernel.Std.Bin_prot.Size.sizer->'atCore_kernel.Std.Bin_prot.Size.sizer
val bin_write_t :
'aCore_kernel.Std.Bin_prot.Write.writer->'atCore_kernel.Std.Bin_prot.Write.writer
val bin_writer_t :
'aCore_kernel.Std.Bin_prot.Type_class.writer->'atCore_kernel.Std.Bin_prot.Type_class.writer
add trie ~key ~data adds data associated with key, if trie already has some data associated with the key, then it will be overwritten
val change : 'at->key->('a option->'a option)-> unit
change trie key f if trie has data associated with key then f will be called with Some data, otherwise it will be called with None. If f returns None then there will be no data associated with key, if f returns Some thing, then thing will be bound to key
val walk : 'at->key->init:'b->f:('b->'a option->'b)->'b
walk trie key ~init ~f walks down the tree starting from the root and ending with the last token of the key. Function f is fold over values associated with all substrings of the key, starting from a zero substring.
longest_match trie k find the value associated with a longest substring of a key k. Returns a pair - a length of matched key and data, associated with that key.