Lines Matching refs:t

18 type ('a, 'b) t  type
23 val create : unit -> ('a,'b) t
26 val mem : ('a,'b) t -> 'a list -> bool
27 (** [mem t k] returns true if a value is associated with the key [k] in the trie [t].
30 val find : ('a, 'b) t -> 'a list -> 'b
31 (** [find t k] returns the value associated with the key [k] in the trie [t].
32 Returns [Not_found] if no values are associated with [k] in [t]. *)
34 val set : ('a, 'b) t -> 'a list -> 'b -> ('a, 'b) t
35 (** [set t k v] associates the value [v] with the key [k] in the trie [t]. *)
37 val unset : ('a, 'b) t -> 'a list -> ('a, 'b) t
38 (** [unset k v] removes the association of value [v] with the key [k] in the trie [t].
40 every nodes of [t] containing no values and having no chil. *)
42 val iter : ('a -> 'b option -> unit) -> ('a, 'b) t -> unit
43 (** [iter f t] applies the function [f] to every node of the trie [t].
44 As nodes of the trie [t] do not necessary contains a value, the second argument of
47 val iter_path : ('a -> 'b option -> unit) -> ('a, 'b) t -> 'a list -> unit
48 (** [iter_path f t p] iterates [f] over nodes associated with the path [p] in the trie [t].
49 If [p] is not a valid path of [t], it iterates on the longest valid prefix of [p]. *)
51 val fold : ('a -> 'b option -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
52 (** [fold f t x] fold [f] over every nodes of [t], with [x] as initial value. *)
54 val map : ('b -> 'c option) -> ('a,'b) t -> ('a,'c) t
55 (** [map f t] maps [f] over every values stored in [t]. The return value of [f] is of type 'c option
58 val sub : ('a, 'b) t -> 'a list -> ('a,'b) t
59 (** [sub t p] returns the sub-trie associated with the path [p] in the trie [t].
60 If [p] is not a valid path of [t], it returns an empty trie. *)