From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id D7835820A1 for ; Thu, 5 Sep 2013 10:24:55 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of garrigue@math.nagoya-u.ac.jp) identity=pra; client-ip=133.6.130.5; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="garrigue@math.nagoya-u.ac.jp"; x-sender="garrigue@math.nagoya-u.ac.jp"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of garrigue@math.nagoya-u.ac.jp) identity=mailfrom; client-ip=133.6.130.5; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="garrigue@math.nagoya-u.ac.jp"; x-sender="garrigue@math.nagoya-u.ac.jp"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mailhost.math.nagoya-u.ac.jp) identity=helo; client-ip=133.6.130.5; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="garrigue@math.nagoya-u.ac.jp"; x-sender="postmaster@mailhost.math.nagoya-u.ac.jp"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtsDAPo+KFKFBoIFdGdsb2JhbABbhzW+HoE8DgEMFQg8giQBAQQBIyABNQIDCwsaAhgOAgJXBhOHfAWnP3SDXAKFYYhHB4EpjgQzB4JpNIEAiTaKaINaij+KVg X-IPAS-Result: AtsDAPo+KFKFBoIFdGdsb2JhbABbhzW+HoE8DgEMFQg8giQBAQQBIyABNQIDCwsaAhgOAgJXBhOHfAWnP3SDXAKFYYhHB4EpjgQzB4JpNIEAiTaKaINaij+KVg X-IronPort-AV: E=Sophos;i="4.90,845,1371074400"; d="scan'208";a="25784078" Received: from rabbit.math.nagoya-u.ac.jp (HELO mailhost.math.nagoya-u.ac.jp) ([133.6.130.5]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Sep 2013 10:24:53 +0200 Received: from mailhost.math.nagoya-u.ac.jp (localhost [127.0.0.1]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 55E2C639F; Thu, 5 Sep 2013 17:24:51 +0900 (JST) Received: from mailhost.math.nagoya-u.ac.jp (localhost [127.0.0.1]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 2E4B52504; Thu, 5 Sep 2013 17:24:51 +0900 (JST) DomainKey-Signature: h=Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=; c=nofws; d=math.nagoya-u.ac.jp; q=; s=alpha Received: from tet.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTPSA id DBC133997; Thu, 5 Sep 2013 17:24:50 +0900 (JST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) From: Jacques Garrigue In-Reply-To: Date: Thu, 5 Sep 2013 17:24:53 +0900 Cc: caml list Content-Transfer-Encoding: quoted-printable Message-Id: <0632AAE4-0DEA-4905-8F70-0646DE62E947@math.nagoya-u.ac.jp> References: To: =?utf-8?Q?Daniel_B=C3=BCnzli?= X-Mailer: Apple Mail (2.1508) Subject: Re: [Caml-list] Stability of order between polymorphic variants On 2013/09/05, at 9:17, Daniel B=C3=BCnzli wr= ote: > Hello,=20=20 >=20 > I have this type=20 >=20 > type weight =3D [ `W100 | `W200 | `W300 | `W400 | `W500 | `W600 | `W700 = | `W800 | `W900 ] >=20 > In the current compiler it has the property that `Wx00 < `Wy00 if x < y.= =20 >=20 > The question is, is the order between polymorphic variants an invariant p= rovided by the compiler or is it subject to change ?=20 >=20 > Best, >=20 > Daniel As was pointed by some, the hashing function ensures that all constructor n= ames up to 4 characters may not conflict, on all architectures. It also preserves the order in that case. Since there is no reason to change this hashing function, I suppose you can= rely on that. Jacques Garrigue=