Legend:
Library
Module
Module type
Parameter
Class
Class type
Finite maps.
The FMap module provides a purely functional finite map datastructure based on balanced binary trees. Most operations on single elements, for example adding bindings or testing membership, can be performed in time logarithmic in the size of the map.
This module provides a superset of the operations in the Map module in the OCaml standard library, but with a polymorphic interface in addition to the standard functorial interface.
A map provided by this module requires a strict order on its domain elements. When using the polymorphic interface, domain elements are compared using the structural comparison operators (=) and (<). For this reason, the polymorphic interface can only be used if semantic equality in the domain type is equivalent to structural equality.
type('a, +'b) t
The type of finite maps with domain type 'a and range type 'b. Values of this type can be considered as finite sets of pairs where an element (x, y) represents the mapping of x to y. The domain of a map m is the set of values x such that m contains a pair (x, y) for some y (m maps x to some value); the range of m is the set of values y such that m contains a pair (x, y) for some x (some value is mapped to y by m).
val equal : ('b->'b-> bool)->('a, 'b)t->('a, 'b)t-> bool
equal cmp m1 m2 tests whether the maps m1 and m2 are equal. Two maps are equal if they have equal domains and map each domain element to equal values, where the values are compared using cmp.
val compare : ('b->'b-> int)->('a, 'b)t->('a, 'b)t-> int
compare cmp returns a total ordering on maps using cmp to compare values.