From: Yaron Minsky <yminsky@janestreet.com>
To: Andreas Rossberg <rossberg@mpi-sws.org>
Cc: OCaML List Mailing <caml-list@inria.fr>
Subject: Re: [Caml-list] Equality between abstract type definitions
Date: Sun, 27 Oct 2013 08:56:35 -0400 [thread overview]
Message-ID: <CACLX4jQD4no0ct0nhjcXXH=LmM8-x0P1MuD_XRGodMks92nuCw@mail.gmail.com> (raw)
In-Reply-To: <66AB5484-8BFC-4A1C-ADAC-99C75716B054@mpi-sws.org>
On Sun, Oct 27, 2013 at 8:16 AM, Andreas Rossberg <rossberg@mpi-sws.org> wrote:
> On Oct 25, 2013, at 22:32 , Yaron Minsky <yminsky@janestreet.com> wrote:
>> Changing the semantics of this will, I think, break a _lot_ of code.
>
> Interesting. Do you have specific examples in mind?
I know that I've seen many examples come up in my code. One common
use is to partially specify a type. For example, if I wanted to
ignore a return value that is a Tcp.Server.t from Async, I would
probably write it like this:
(ignore server : ('a,'b) Tcp.Server.t)
without specifying the sometimes rather complicated details of those
types. Similarly, if I were to ignore a Map, I might write
(ignore map : (int,string,'a) Map.t
since it's not helpful here to specify the comparator type, which is
what goes into the third slot here.
Nowadays, I would probably use an underscore in these cases rather
than an explicit type variable, but our codebase has plenty of old
examples of this kind of thing. If a change like the one you propose
is changed, I presume that _ would keep its current meeting, which
would address many use cases.
Given the existence of such use-cases, I would hope that we could
avoid making the change in a way that would non-optionally break lots
of code. If people agree this change should be made, perhaps it
should be done in the mode of -strict-sequence. That change was added
as a flag, so users could take it at their own pace.
>> 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.
>
> Maybe, but it's not my impression that this is true for most people I see asking related questions here on the list or on SO.
To be clear, my guess above is less than scientific.
>> 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.
>
> Now, _that_ is something I would only expect from programmers trained on SML -- ancient SML'90 to be precise. ;)
>
> Note how OCaml already uses '_a for a sort of flexible variable in its output.
Where?
> /Andreas
>
next prev parent reply other threads:[~2013-10-27 12:56 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
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 [this message]
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='CACLX4jQD4no0ct0nhjcXXH=LmM8-x0P1MuD_XRGodMks92nuCw@mail.gmail.com' \
--to=yminsky@janestreet.com \
--cc=caml-list@inria.fr \
--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