Lines Matching refs:a
18 type ('a, 'b) t
19 (** The type of tries. ['a list] is the type of keys, ['b] the type of values.
20 Internally, a trie is represented as a labeled tree, where node contains values
21 of type ['a * 'b option]. *)
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
34 val set : ('a, 'b) t -> 'a list -> 'b -> ('a, 'b) t
37 val unset : ('a, 'b) t -> 'a list -> ('a, 'b) t
42 val iter : ('a -> 'b option -> unit) -> ('a, 'b) t -> unit
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
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
54 val map : ('b -> 'c option) -> ('a,'b) t -> ('a,'c) t
56 as one may wants to remove value associated to a key. This function is not tail-recursive. *)
58 val sub : ('a, 'b) t -> 'a list -> ('a,'b) t
60 If [p] is not a valid path of [t], it returns an empty trie. *)