From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3SMukvf025393 for ; Fri, 29 Apr 2011 00:56:46 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjgCALbvuU3RVaE2kGdsb2JhbACleQgUAQEBAQkJDQcUBCGqSYp8gieFMDSIXgEBAwaFcASOXIgIgiI7g0I X-IronPort-AV: E=Sophos;i="4.64,283,1301868000"; d="scan'208";a="107028778" Received: from mail-fx0-f54.google.com ([209.85.161.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 29 Apr 2011 00:56:41 +0200 Received: by fxm11 with SMTP id 11so4486233fxm.27 for ; Thu, 28 Apr 2011 15:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/IyRz8ImUTq9UFj9d3ItXD/bKJ4R8csY15SS2Xu941c=; b=tqw0RViHlJoBHZSFXASP2MJPfDu/AVndj1JgANKiQ1TCff85Aq+WyikiW8fRWXNVAN 1fejjSWc5ljGRRw/bcuvf6/afRN6R7aWoBnaCeXjqRZpNM3drCm/rOqcLdYFoJGqac6X bKwesECg6WdJItpIdL26BSEQns3T3fkJfuQZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=YJeoJpjNndAQokmlcBSQ3+CsosGrWwKi99hwbsFhDFcN69Rbxx7QdaaspGQw5djFvx 46ge8wn+fZCq1dUf3R5omcLL8dFq/4KNzQs+N+gXaxN3ht+N+vNogBLUak15wJNr2UaR Ttr29ftAyXBqyxiMM6EHoJT6OZpeylKAf0IXQ= MIME-Version: 1.0 Received: by 10.223.148.147 with SMTP id p19mr521881fav.140.1304031401241; Thu, 28 Apr 2011 15:56:41 -0700 (PDT) Received: by 10.223.96.197 with HTTP; Thu, 28 Apr 2011 15:56:41 -0700 (PDT) In-Reply-To: <2E33DAF4-C496-41ED-9208-61E66BD1AB82@gmail.com> References: <2E33DAF4-C496-41ED-9208-61E66BD1AB82@gmail.com> Date: Thu, 28 Apr 2011 18:56:41 -0400 Message-ID: From: Ethan Burns To: Vincent Aravantinos Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Validation-by: burns.ethan@gmail.com Subject: Re: [Caml-list] Comparing variant types On Thu, Apr 28, 2011 at 5:07 PM, Vincent Aravantinos wrote: > Hi, > > without entering any details, probably the following links would be > interesting to you: > > http://ocaml.janestreet.com/?q=node/33 > http://ocaml.janestreet.com/?q=node/35 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. Ethan