caml-list - the Caml user's mailing list
 help / Atom feed
From: Enrico Tassi <>
Subject: Re: [Caml-list] How to rename a record field
Date: Thu, 6 Sep 2018 16:18:09 +0200
Message-ID: <20180906141809.6m4vcwnsqqqbsack@gargamel> (raw)
In-Reply-To: <>

On Thu, Sep 06, 2018 at 10:17:25PM +0900, Jacques Garrigue wrote:
> Records being the dual of variants, all the arguments apply.
> Namely, if the name is allowed to change, field access can no longer
> be seen as the intuitive projection (by name rather than position, since
> only name information is available in the source code).
> Field name disambiguation works in the same way too.

Thanks. I see why in the general case this makes the source code

> >  type old = { bad : int; stuff : bool }
> >  type t = old = { good : int; stuff : bool }

But in a case as simple as this one where names are either different
or occur in the same position I believe there is no ambiguity.
"stuff" would always resolve to position 2 while both
"good" and "bad" to position 1.

I'm not knowledgeable enough to follow your reasoning about GADTs.
Maybe the approach I propose is really unsound, even if I fail to get
it. Still I believe the use case (renaming + deprecating a record field)
is relevant. Any other approach (especially not requiring to patch OCaml)
would make me happy.

Enrico Tassi

Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports:

  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 11:36 Enrico Tassi
2018-09-06 11:40 ` Gabriel Scherer
2018-09-06 13:03   ` Enrico Tassi
2018-09-06 13:17     ` Jacques Garrigue
2018-09-06 14:18       ` Enrico Tassi [this message]
2018-09-06 23:35         ` Jacques Garrigue
2018-09-06 16:21 ` Alain Frisch
2018-09-06 16:21   ` Alain Frisch
2018-09-06 23:45     ` Jacques Garrigue
2018-09-07  8:37       ` Alain Frisch
2018-09-07 10:14         ` Jacques Garrigue
2018-09-07 12:50           ` Alain Frisch

Reply instructions:

You may reply publically 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:

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

  git send-email \
    --in-reply-to=20180906141809.6m4vcwnsqqqbsack@gargamel \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror

AGPL code for this site: git clone public-inbox