Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Dependant association lists.
Type of tokens used to make keys unique, and carrying a type. This type is not intended to be extended by the user, hence it is private... but not declared priveta as it fails if 4.04
Type of a key for a value of type 'a
. It contains a unique token and the corresponding (very efficient) equality test.
val new_key : unit -> 'a key
new_key ()
generates a new unique key for a value of type 'a
.
val empty : t
empty
is the empty association list.
add k v l
inserts a new binding of k
to v
at the head of l
. A previous binding of k
will not be removed. Hence removing k
will uncover a previous binding.
val length : t -> int
length l
returns the size of the association list l
.
add_key v l
is equivalent to let k = new_key () in (k, add k v l)
.
find k l
returns the latest inserted value with key k
in list l
. The exception Not_found
is raised if there is none.
remove k l
removes the latest inserted binding of the key k
in l
. If there is no such binding, then Not_found
is raised.
replace k l
replaces a previous binding if it exists. If two bindings existed, only the first is removed to be replaced.
append l1 l2
concatenate the two association lists. Duplicated are not removed.
Iterator