caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yaron Minsky <yminsky@janestreet.com>
To: Andreas Rossberg <rossberg@mpi-sws.org>
Cc: Gabriel Scherer <gabriel.scherer@gmail.com>,
	Ivan Gotovchits <ivg@ieee.org>,
	 Roberto Di Cosmo <roberto@dicosmo.org>,
	Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>,
	 OCaML List Mailing <caml-list@inria.fr>
Subject: Re: [Caml-list] Equality between abstract type definitions
Date: Fri, 25 Oct 2013 16:32:12 -0400	[thread overview]
Message-ID: <CACLX4jSUaC3vzXH1JZz8V0YEpM1uC+yMsmUv=HNasavgwyeE+w@mail.gmail.com> (raw)
In-Reply-To: <526A7F33.6040203@mpi-sws.org>

Changing the semantics of this will, I think, break a _lot_ of code.
I for one am not excited to do so.

For what it's worth, I suspect that most people who are surprised by
this are people who were trained on Standard ML.  At Jane Street we've
had a lot of people learn the language, and the complaints I've heard
about this feature are, I think, mostly from that group.

I also don't find Andreas suggestion particularly intuitive.  I would
have guessed that (x: '_a) would constrain x to be a weakly
polymorphic value, which is at odds with the proposal.

y

On Fri, Oct 25, 2013 at 10:24 AM, Andreas Rossberg <rossberg@mpi-sws.org> wrote:
> On 10/25/2013 01:09 PM, Gabriel Scherer wrote:
>>
>> However, I think that the current syntax of implicitly-introduced
>> variables with heuristically-defined scoping rules is bad in any case.
>> My own toy experiment with explicit syntaxes always use an explicit
>> binding syntax for both rigid and flexible variables (eg. "forall a b c
>> in ..." and "some a b c in ..."). In this regard, the ('a 'b . ty) or
>> (type a) syntaxes are definite improvements -- if only we had applied
>> those explicit binding forms to GADT constructor types as well... So I
>> think that even with Andreas' proposed change, people would still be
>> surprised by things like the following:
>>
>>    let id : 'a -> 'a = fun x -> x
>>
>>    let dup (x : 'a) ('a * 'a) =
>>      let result = (x, x) in
>>      (id : 'a -> 'a) result  (* fails, while (id : 'b -> 'b) works *)
>
>
> Yes, I agree that implicit scoping is a bit of an ugly hack. That said, I
> don't expect anybody to be truly surprised about the example above. At least
> I never heard this being an issue for SML programmers. People probably
> hardly ever write anything like the above, or avoid shadowing for clarity
> anyway.
>
> /Andreas
>
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2013-10-25 20:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 22:57 Peter Frey
2013-10-24 23:23 ` Jacques Garrigue
2013-10-25  6:44   ` Andreas Rossberg
2013-10-25  8:29     ` Roberto Di Cosmo
2013-10-25  9:59       ` Ivan Gotovchits
2013-10-25 11:09         ` Gabriel Scherer
2013-10-25 14:24           ` Andreas Rossberg
2013-10-25 20:32             ` Yaron Minsky [this message]
2013-10-25 20:44               ` Jacques Le Normand
2013-10-26  1:08                 ` Norman Hardy
2013-10-26  5:28                   ` Jacques Garrigue
2013-10-27 12:16               ` Andreas Rossberg
2013-10-27 12:56                 ` Yaron Minsky
2013-10-27 14:28                   ` Gabriel Scherer
2013-10-27 14:43                     ` Yaron Minsky
2013-10-27 15:25                       ` Gabriel Scherer
2013-10-27 15:41                         ` Yaron Minsky
2013-10-25 12:35         ` Roberto Di Cosmo
2013-10-25 12:45           ` Jonathan Protzenko
2013-10-25 13:20             ` Roberto Di Cosmo
2013-10-25 14:03       ` Andreas Rossberg
2013-10-26  9:07         ` oleg
2013-10-26 14:11           ` Didier Remy
2013-10-26 17:32         ` Didier Remy
2013-10-27 12:07           ` Andreas Rossberg
2013-10-27 14:10             ` Roberto Di Cosmo
2013-10-28  3:30     ` Jacques Garrigue

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='CACLX4jSUaC3vzXH1JZz8V0YEpM1uC+yMsmUv=HNasavgwyeE+w@mail.gmail.com' \
    --to=yminsky@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=gabriel.scherer@gmail.com \
    --cc=garrigue@math.nagoya-u.ac.jp \
    --cc=ivg@ieee.org \
    --cc=roberto@dicosmo.org \
    --cc=rossberg@mpi-sws.org \
    /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).