caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: Jeremy Yallop <yallop@gmail.com>
Cc: "Daniel Bünzli" <daniel.buenzli@erratique.ch>,
	"caml list" <caml-list@inria.fr>
Subject: Re: [Caml-list] Stability of order between polymorphic variants
Date: Thu, 5 Sep 2013 16:46:26 +0200	[thread overview]
Message-ID: <20130905144626.GA31556@frosties> (raw)
In-Reply-To: <CAAxsn=FV00_ky3Zfd8yN9H01fe2wPs5MVpmrPtsyK6M4YYmuQQ@mail.gmail.com>

On Thu, Sep 05, 2013 at 10:26:42AM +0100, Jeremy Yallop wrote:
> On 5 September 2013 01:17, Daniel Bünzli <daniel.buenzli@erratique.ch> 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

      reply	other threads:[~2013-09-05 14:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05  0:17 Daniel Bünzli
2013-09-05  2:06 ` Anthony Tavener
2013-09-05  2:11   ` Anthony Tavener
2013-09-05  2:18     ` Francois Berenger
2013-09-05  2:31       ` Anthony Tavener
2013-09-05  7:47         ` Stéphane Glondu
2013-09-05  8:24 ` Jacques Garrigue
2013-09-05  8:39   ` Mark Shinwell
2013-09-05  9:26 ` Jeremy Yallop
2013-09-05 14:46   ` Goswin von Brederlow [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130905144626.GA31556@frosties \
    --to=goswin-v-b@web.de \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    --cc=yallop@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).