On 04/29/2011 12:57 AM, Ethan Burns wrote: > Thanks for the links. Actually, I think that understand OCaml's > polymorphic comparison and how to get rid of it (for the most part). I > guess that I just found it surprising that the compiler doesn't seem > to optimize it away in this case (a variant type used as an > enumeration with only simple constructors). I suppose that one > solution would be to just use let-bindings to associate integers with > names "by hand" instead of using the variant type. I don't really > like that approach too much, however. Indeed, the compiler does not do it... yet. But it's already somewhere on someone's TODO list ;-) Fabrice