package ocp-index
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b93ed30df9ca321ff5758cdf43976034bcc5b3a23f83fcebbd524ea505e090d1
sha512=40d585edde42048d03b7672f29a0e4d0b92903d7b65f6d34f0c59d7ce29606bfc85a937b4967aea267eeb4f398990ec7ba8ec844858e433ce080a7f195a709b8
doc/ocp-index.lib/Trie/index.html
Module Trie
This module defines a generic data structure: Lazy tries based on lists
val empty : ('a, 'b) tCreate a new trie with the given components
val mem : ('a, 'b) t -> 'a list -> boolReturns true if there is a value associated with the given path
val find : ('a, 'b) t -> 'a list -> 'bReturns the value associated with the given path.
val find_all : ('a, 'b) t -> 'a list -> 'b listReturns all values associated with the given path, most recent first.
Associates a value with the given path, or replaces if there was already one
Associates a value with the given path, keeping previous bindings
Removes all associations to a given key from the trie. Warning: doesn't cleanup branches that don't point to anything anymore
map_subtree tree path f applies f on value and children of the node found at path in tree, and bind the returned node back at that position in the tree
val iter : ('a list -> 'b -> unit) -> ('a, 'b) t -> unititers over all the bindings in the trie, top-down
val fold : ('acc -> 'a list -> 'b -> 'acc) -> ('a, 'b) t -> 'acc -> 'accfolds over all bindings of the trie, bottom-up
val fold0 : ('acc -> 'a list -> 'b list -> 'acc) -> ('a, 'b) t -> 'acc -> 'accsame as fold, but the list of bindings at a given path is given at once
sub t p returns the sub-trie associated with the path p in the trie t. If p is not a valid path of t, it returns an empty trie.
filter f t returns t with all subtrees for which f key = false pruned
graft tree path subtree grafts the children of subtree in tree at path, replacing the whole subtree
Merges two tries, accepting an optional function to resolve value conflicts. The default function pushes right-hand values on top of left-hand ones