4 ms·
minor nitpick - even if "OCaml has no equivalent of Haskell's Ordering or SML's order types" there is Pervasives.compare. it returns {0,-1,+1} rather than {EQ,
by zem 12y ago
minor nitpick - even if "OCaml has no equivalent of Haskell's Ordering or SML's order types" there is Pervasives.compare. it returns {0,-1,+1} rather than {EQ, LT, GT}, but you can still say
match compare x v with
| 0 -> ...
| 1 -> ...
| _ -> ...
with the minor wart that since compare returns an int, you need to match the last case with a default to prevent the compiler from warning you about possibly not matching other int values.