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 p3T8kUI2016233 for ; Fri, 29 Apr 2011 10:46:35 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocDAPF5uk1KfVK2imdsb2JhbACEUZN4jTMIFAEBAQoJDQcSBiGpE4pAgmOFJIkSAQEDBoR3gQEEjmiEF4EOhQ87gSOCCg X-IronPort-AV: E=Sophos;i="4.64,286,1301868000"; d="vcf'?scan'208";a="107057110" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 29 Apr 2011 10:46:35 +0200 Received: by mail-wy0-f182.google.com with SMTP id 23so4885276wyf.27 for ; Fri, 29 Apr 2011 01:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:x-enigmail-version :content-type; bh=BMADdjhPru0hmqAQLt36EpGWKm67eQouZk1CSsA9Sl8=; b=ms13MLtT2Zc3zfGHAdTfrzBt8OOiw3zUIPFA+qPGcY+yma6QiL9g9pNB+DnXlVIjzj nl2mqUecJ6I91AHsBqrym0ddwEcWQEs9qGG2GALYEmCU2ogO/nxzCPgySB8KOnXI4qrg AFb1qAI4G85XCJQQiLp6uiqw2Nk6bFHyymcX4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; b=P6gu1FjQS/7zrEdv61oCGqac7uW4NWoOUByCFm9LlcHhvHIvdIW2/IHyCBtTiRuuF+ J7+ue+HWjj1iGtb28+N8OBNNY7hpGuh7zy45fiByTu3iwQOnQnulM+K6BsOtr+M6tDnZ 3jTXnjGh3gSEGR1gkVpXYm9uY6+HjmAwZ+TPU= Received: by 10.216.238.132 with SMTP id a4mr312973wer.68.1304066795534; Fri, 29 Apr 2011 01:46:35 -0700 (PDT) Received: from [195.83.212.218] (chercheurs-218.saclay.inria.fr [195.83.212.218]) by mx.google.com with ESMTPS id z13sm1563302wbd.29.2011.04.29.01.46.33 (version=SSLv3 cipher=OTHER); Fri, 29 Apr 2011 01:46:33 -0700 (PDT) Sender: Fabrice Le Fessant Message-ID: <4DBA7AE8.7040404@inria.fr> Date: Fri, 29 Apr 2011 10:46:32 +0200 From: Fabrice Le Fessant User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: caml-list@inria.fr References: <2E33DAF4-C496-41ED-9208-61E66BD1AB82@gmail.com> <354087020.772283.1304031467793.JavaMail.root@zmbs4.inria.fr> In-Reply-To: <354087020.772283.1304031467793.JavaMail.root@zmbs4.inria.fr> X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------090202010502000501070905" X-Validation-by: fabrice.le_fessant@inria.fr Subject: Re: [Caml-list] Comparing variant types This is a multi-part message in MIME format. --------------090202010502000501070905 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --------------090202010502000501070905 Content-Type: text/x-vcard; charset=utf-8; name="fabrice_le_fessant.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fabrice_le_fessant.vcf" begin:vcard fn:Fabrice LE FESSANT n:LE FESSANT;Fabrice org:INRIA Saclay -- Ile-de-France;P2P & OCaml adr;quoted-printable:;;Parc Orsay Universit=C3=A9 ;Orsay CEDEX;;91893;France email;internet:fabrice.le_fessant@inria.fr title;quoted-printable:Charg=C3=A9 de Recherche tel;work:+33 1 74 85 42 14 tel;fax:+33 1 74 85 42 49 url:http://fabrice.lefessant.net/ version:2.1 end:vcard --------------090202010502000501070905--