Module Stdlib.PairSource
Operations on pairs.
Pairs
The type for pairs.
make a b is the pair (a, b).
fst (a, b) is a.
snd (a, b) is b.
swap (a, b) is (b, a).
Iterators
fold f (a, b) applies f to a and b.
map f g (a, b) applies f to a and g to b.
iter f g (a, b) first applies f to a, and then g to b.
map_fst f p applies f to p's first component.
map_snd f p applies f to p's second component.
Predicates and comparisons
equal eqa eqb (a1, b1) (a2, b2) is true if and only if eqa a1 a2 and eqb b1 b2 are both true.
compare cmpa cmpb is a total order on pairs using cmpa to compare the first component, and cmpb to compare the second component. It is implemented by a lexicographic order.