|
|
|
|
|
by zem
4098 days 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. |
|