[ghc-steering-committee] RecordDotSyntax proposal: next steps

Simon Marlow marlowsd at gmail.com
Tue Mar 17 13:31:25 UTC 2020


Should the text "except when parenthesised (.x)" in C2b also be added to
C2a?

Note 5 should apply to C7 too, now?

On Mon, 16 Mar 2020 at 14:43, Simon Peyton Jones <simonpj at microsoft.com>
wrote:

> The examples are good, but I know from experience it's easy to overlook
> things if we don't consider what the precise grammar is, both at the
> lexical and context-free levels. So I wouldn't feel comfortable voting on a
> proposal where the grammar isn't completely clear.
>
> I agree with that in principle, but I don’t want to ask the authors to
> work up 6 or 7 different full syntaxes, just to us to accept at most one.
> If it turns that the one we accept (if indeed we accept any) is hard to
> define, let’s revisit.
>

OK, sounds reasonable.


>
>    - Is (.a.b) legal? Under which alternatives? What about (.a .b)? What
>    about (. .x)?
>
> I have added some new words to clarify lexical syntax, which should answer
> your question.  Please say if not.
>
>    - Does ( .x) mean (.x) or (. x)?
>
> Same as any other operator like (+). You can write (+ ) or ( +) or (+) or
> ( + ).   But since (. x) has  lexeme for “.” and one for “x”, that’s
> different.  See the new words.
>
>    - I presume under C2a things like 3.x, "abc".y, and [1,2,3].z would be
>    legal…
>
> One of the great disadvantages of C2a and C3 is the awkwardness of
> defining tight infix for dot.  See Note 4.
>
>    - data R = R { (.) :: Int }   This is a good point which applies to
>    the entire proposal.  It needs to be addressed.  But it’s very much a
>    corner case, and we should not let the tail wag the dog.
>
> OK. But the misdesign of qualified identifiers led to the situation where
no Haskell compiler conforms to the spec, since the spec is silly (eg. the
spec says M... lexes as the two lexemes M.. .). We should strive to avoid
making that situation worse.

>
>    -
>    - Can I use a record selector infix by surrounding it with ``? i.e. is
>    `.x` a legal infix operator?  (I'm guessing not)
>
> You can clearly say `(.x)`.   I would guess that you can’t omit the
> parens.  Again, should ultimately be nailed down but doesn’t really affect
> our decision making.
>

Really? You can't say `(+)` right now in Haskell, so it would be surprising
if you could say `(.x)`

> Do the clarifications in the document allow you enough clarity to make an
> informed choice?
>

Kind of :) I'm happy to proceed on the basis that we're choosing high-level
direction and the details will be worked out later, but it may be that some
or all of these proposals lead to significant ugliness in their full
specification.

Cheers
Simon



>
>
> Simon
>
>
>
>
>
> *From:* Simon Marlow <marlowsd at gmail.com>
> *Sent:* 15 March 2020 13:22
> *To:* Simon Peyton Jones <simonpj at microsoft.com>
> *Cc:* Christopher Allen <cma at bitemyapp.com>; Cale Gibbard <
> cgibbard at gmail.com>; ghc-steering-committee <
> ghc-steering-committee at haskell.org>
> *Subject:* Re: RecordDotSyntax proposal: next steps
>
>
>
> The examples are good, but I know from experience it's easy to overlook
> things if we don't consider what the precise grammar is, both at the
> lexical and context-free levels. So I wouldn't feel comfortable voting on a
> proposal where the grammar isn't completely clear. Some questions that come
> to mind given the current set of proposals:
>
>
>
> Is (.a.b) legal? Under which alternatives? What about (.a .b)? What about
> (. .x)?
>
>
>
> Does ( .x) mean (.x) or (. x)?
>
>
>
> I presume under C2a things like 3.x, "abc".y, and [1,2,3].z would be
> legal, given suitable instances for Integral, IsString, or IsList? Which
> other proposals does that apply to?
>
>
>
> If I have a record with a varsym field name, can I use dot syntax with it?
> e.g.
>
> data R = R { (.) :: Int }
>
> Now can I say r.(.) or r..? (note that the qualified name equivalent of
> this is M.. which is legal). If r.. is legal, presumably I should be able
> to use (..)? I suspect there are a lot of worms in this can :)
>
>
>
> Can I use a record selector infix by surrounding it with ``? i.e. is `.x`
> a legal infix operator?  (I'm guessing not)
>
>
>
> By the way, I understand the authors of the original proposal are against
> C5 so if that were the committee's preferred option then someone else would
> need to adopt the proposal.
>
>
>
> Cheers
>
> Simon
>
>
>
> On Fri, 13 Mar 2020 at 17:43, Simon Peyton Jones <simonpj at microsoft.com>
> wrote:
>
> Thanks.   You can’t vote if you don’t understand the alternatives!  And if
> you can’t maybe others can’t – or will do so based on different
> understandings of the same thing.  That would be Bad.
>
>
>
> I’m not well positioned to fix this because I don’t know where the
> ambiguities are.  Would you like to ask some clarifying questions?
>
>
>
> Simon
>
>
>
> *From:* Simon Marlow <marlowsd at gmail.com>
> *Sent:* 13 March 2020 17:30
> *To:* Simon Peyton Jones <simonpj at microsoft.com>
> *Cc:* Christopher Allen <cma at bitemyapp.com>; Cale Gibbard <
> cgibbard at gmail.com>; ghc-steering-committee <
> ghc-steering-committee at haskell.org>
> *Subject:* Re: RecordDotSyntax proposal: next steps
>
>
>
> It's still a bit hard (IMO) to understand what precise changes each
> proposal would make to the syntax, but I don't want to hold things up so
> I've added an AYE.
>
>
>
> Cheers
>
> Simon
>
>
>
> On Fri, 13 Mar 2020 at 10:38, Simon Peyton Jones <simonpj at microsoft.com>
> wrote:
>
> Chris, Cale, Simon
>
> I wonder if you might have a moment to respond to this email?
>
> Thanks
>
> Simon
>
>
>
> *From:* Simon Peyton Jones <simonpj at microsoft.com>
> *Sent:* 09 March 2020 09:56
> *To:* ghc-steering-committee <ghc-steering-committee at haskell.org>
> *Cc:* Simon Peyton Jones <simonpj at microsoft.com>
> *Subject:* RE: RecordDotSyntax proposal: next steps
>
>
>
> Colleagues
>
> Thanks for your various replies.   I have
>
>    - Added a couple more examples (please check)
>    - Split (C2a) and (C2b) – thank you Joachim for filling out the list.
>    - Add a Notes section that identifies some consequences, hopefully
>    objectively.
>    - Added a list  at the end where you can add your AYE when happy.
>
> Can you review, and Christopher, Richard, Cale, Simon, Eric, Alejandro,
> Arnaud: please add AYE or suggest further changes.
>
> This is painstaking but I think it is clarifying. I have found writing out
> the examples is quite helpful.  Feel free to suggest more if you think
> there are some cases that are unclear.
>
> Thanks
>
> Simon
>
>
>
> *From:* Simon Peyton Jones <simonpj at microsoft.com>
> *Sent:* 06 March 2020 17:59
> *To:* ghc-steering-committee <ghc-steering-committee at haskell.org>
> *Cc:* Simon Peyton Jones <simonpj at microsoft.com>
> *Subject:* RecordDotSyntax proposal: next steps
>
>
>
> Colleagues
>
> I’m sorry to have been dragging my feet on the records proposal.   First
> there was half term holiday, and then the ICFP deadline, so I’ve been out
> of action for several weeks.
>
> It’s pretty clear that we are not going to achieve 100% consensus, so the
> right thing to do is to vote, using the single-transferrable-vote scheme
> that Joachim runs.  It’s worth striving for consensus, because the debate
> can be clarifying (and has been!).  But I don’t regard non-consensus as a
> failure.  These things are all judgement calls, and people’s judgement can
> legitimately differ.   Voting lets us nevertheless reach a conclusion.
>
> So here’s what I propose
>
>    - I’ve put up a list of choices for us to vote on here
>    <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.google.com%2Fdocument%2Fd%2F1MgovHRUUNjbuM4nM8qEe308MfbAYRh2Q8PxFHl7iY74%2Fedit%3Fusp%3Dsharing&data=02%7C01%7Csimonpj%40microsoft.com%7C6211b3c422ef483414b708d7c8e3d967%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637198753236487549&sdata=PZo0sVH3fsQPAecTzN5DCsN9UNbaaGi563PxuO2%2BnaI%3D&reserved=0>,
>    informed by our most recent email exchanges. The first thing is to ensure
>    that this list is
>
>
>    1. *Complete*: no choices that people really want are omitted.
>       2. *Clear* *and unambiguous*.  When we vote we must know exactly
>       what we are voting for!
>
> *Can you all respond about that, including “Aye” if you think it is both
> complete and clear*.
>
>    - Once we are all satisfied, I’ll invite you to vote.  The easiest way
>    to do so might be to edit the Google doc directly, so there’s a single
>    point of reference.
>
> Please also let me know if you think we should be doing anything else.
>
> Thanks!
>
> Simon
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20200317/bfc64e6b/attachment-0001.html>


More information about the ghc-steering-committee mailing list