Thanks to all for your answers. I am aware my code exemple is quite artificial, certainly integers are simpler in this particular case. My more profound question was: are variants treated as an enumeration or not ? And the answer is: OCaml variants are certainly treated as an initial algebra, but not exactly as an enumeration, thus their relative order is not meaningfull to the compare function. And it will not change in near future. Ok, i can live with that. - damien