let iter: ('a=> unit)=>('b=> unit)=>('a, 'b)=> unit;
iter f g (a, b) first applies f to a, and then g to b.
let map_fst: ('a=>'c)=>('a, 'b)=>('c, 'b);
map_fst f p applies f to p's first component.
let map_snd: ('b=>'c)=>('a, 'b)=>('a, 'c);
map_snd f p applies f to p's second component.
Predicates and comparisons
let equal:
('a=>'a=> bool)=>('b=>'b=> bool)=>('a, 'b)=>('a, 'b)=>
bool;
equal eqa eqb (a1, b1) (a2, b2) is true if and only if eqa a1 a2 and eqb b1 b2 are both true.
let compare:
('a=>'a=> int)=>('b=>'b=> int)=>('a, 'b)=>('a, 'b)=>
int;
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.