Untitled

mail@pastecode.io avatar
unknown
ocaml
2 years ago
242 B
0
Indexable
Never
let pairwise p1 p2 comp_x comp_y =
  match p1, p2 with
    (x1, y1), (x2, y2) -> comp_x x1 x2 && comp_y y1 y2;;

let lexicographic p1 p2 comp_x comp_y =
  match p1, p2 with
    (x1, y1), (x2, y2) -> comp_x x1 x2 || (x1 = x2 && comp_y y1 y2);;