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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8D710820A1 for ; Thu, 5 Sep 2013 11:26:43 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yallop@gmail.com) identity=pra; client-ip=209.85.212.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yallop@gmail.com designates 209.85.212.176 as permitted sender) identity=mailfrom; client-ip=209.85.212.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f176.google.com) identity=helo; client-ip=209.85.212.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="postmaster@mail-wi0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYBAA1NKFLRVdSwk2dsb2JhbABbhA2DKL4egSAIFg4BAQEBBwsLCRQEJIIkAQEFIx0BGx0BAwwGBQsNAgImAgIiAREBBQEcBhMIh2cBAw+cQIt/UYMFhDsKGScNZIg7AQUMgR2OBDMHgmmBNAOUG4Naij+FPhgphEk7 X-IPAS-Result: AqYBAA1NKFLRVdSwk2dsb2JhbABbhA2DKL4egSAIFg4BAQEBBwsLCRQEJIIkAQEFIx0BGx0BAwwGBQsNAgImAgIiAREBBQEcBhMIh2cBAw+cQIt/UYMFhDsKGScNZIg7AQUMgR2OBDMHgmmBNAOUG4Naij+FPhgphEk7 X-IronPort-AV: E=Sophos;i="4.90,845,1371074400"; d="scan'208";a="25795174" Received: from mail-wi0-f176.google.com ([209.85.212.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Sep 2013 11:26:43 +0200 Received: by mail-wi0-f176.google.com with SMTP id cb5so4637707wib.3 for ; Thu, 05 Sep 2013 02:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7bp/L4mCW7NMDfl78hmnr5XiqMM/f8IlCkiF9Uk3tAk=; b=Py79UKN3fvUEz4suAD6wxapUOXz7umzaECjFdg7aCLsVdXPGG5I5coeoiwn3RziSy4 5GLAeZUSLht2jiByO7SKmX2+CVE1KQ7VTrnRkEl1MhWf0Q4/LSM6FS/A3NTnKBdmxQrM Ov2SPPvBr/5UkkaxVGqoukX5Hf7pXwsexzv+1dNensXKb/gJvxNERledBkDTdW8d+QBy w2ncpRwverYMj28HpkJcUX4HFNdkK6dHVYRx/ttkLfFacK6nT6VGk4OwWM/+g5ig5EuL o+cp0Xa2d0CHorzDQP4BQOUuHtljCYrV7rrHdLjZOxGmyqaW2u2cJrUSxK2Tdu0BapPF bZ1A== MIME-Version: 1.0 X-Received: by 10.181.12.75 with SMTP id eo11mr5581954wid.24.1378373202880; Thu, 05 Sep 2013 02:26:42 -0700 (PDT) Received: by 10.216.20.79 with HTTP; Thu, 5 Sep 2013 02:26:42 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 Sep 2013 10:26:42 +0100 Message-ID: From: Jeremy Yallop To: =?UTF-8?Q?Daniel_B=C3=BCnzli?= Cc: caml list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Stability of order between polymorphic variants On 5 September 2013 01:17, Daniel B=C3=BCnzli = wrote: > The question is, is the order between polymorphic variants an invariant p= rovided 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 rejecte= d.