From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id A6BE3820A1 for ; Thu, 5 Sep 2013 16:46:32 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.15.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=mailfrom; client-ip=212.227.15.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.15.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjoBAPyYKFLU4w8Em2dsb2JhbABbwCGFNYEnFg4BAQEBAQYLCwkUKIIkAQEFMgFGEAsYCSUPBSghE4dvARawax+JJo9gB4MdgQADlBuDWYYZhCeKSQ X-IPAS-Result: AjoBAPyYKFLU4w8Em2dsb2JhbABbwCGFNYEnFg4BAQEBAQYLCwkUKIIkAQEFMgFGEAsYCSUPBSghE4dvARawax+JJo9gB4MdgQADlBuDWYYZhCeKSQ X-IronPort-AV: E=Sophos;i="4.90,847,1371074400"; d="scan'208";a="31653200" Received: from mout.web.de ([212.227.15.4]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 05 Sep 2013 16:46:29 +0200 Received: from frosties.localnet ([95.208.119.3]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MNcMo-1VKJr72u1C-007EYd for ; Thu, 05 Sep 2013 16:46:27 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.80) (envelope-from ) id 1VHapG-0008E2-8c; Thu, 05 Sep 2013 16:46:26 +0200 Date: Thu, 5 Sep 2013 16:46:26 +0200 From: Goswin von Brederlow To: Jeremy Yallop Cc: Daniel =?iso-8859-1?Q?B=FCnzli?= , caml list Message-ID: <20130905144626.GA31556@frosties> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:vqhM4Q2Whx5wn/AsrvUUaaLGjcyfnjYoCWUS0PUCxq8sBwFDjhc 8n2y6L1a7vGQwDa5p9xoqk8cgQWTpjQf7l94galcF6Zj0rC6GLR/Nhg3uJRw7p02Gy5TStR 1r8RmYeZQdTw0qKMhVIrc8b9R9jxZYpiqAVz8ynbdI+bBNXXxj09zf0WSgCB/k0v0GzzSZU eM6yv2qb8Y66D96vOYi8w== Subject: Re: [Caml-list] Stability of order between polymorphic variants On Thu, Sep 05, 2013 at 10:26:42AM +0100, Jeremy Yallop wrote: > On 5 September 2013 01:17, Daniel Bünzli wrote: > > The question is, is the order between polymorphic variants an invariant provided by the compiler or is it subject to change ? > > The order is fairly unlikely to change. It's based on a hash function > that's used during type checking to determine whether tags can occur > in the same type: > > # [`premiums; `squigglier];; > Characters 12-23: > [`premiums; `squigglier];; > ^^^^^^^^^^^ > Error: Variant tags `premiums and `squigglier have the same hash value. > Change one of them. > > Changing the hash function could cause some existing programs to be rejected. Wow, those names even look sensible. Nice collision example. MfG Goswin