let
compare (a1, b1) (a2, b2) =
let
res = cmp a1 a2
in
if
res = 0
then
cmp b1 b2
else
res