<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Upon careful consideration, I think the whitespace concerns here are somewhat ill-founded.<div class=""><br class=""></div><div class="">First, please see <a href="https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst#proposed-change-specification" class="">https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst#proposed-change-specification</a>, where (among other points), a careful description of "loose infix" vs "prefix" vs "suffix" vs "tight infix" is discussed. Here is a set of examples:</div><div class=""><pre class="">a <span class="pl-k">!</span> b   <span class="pl-c"><span class="pl-c">--</span> a loose infix occurrence</span>
a<span class="pl-k">!</span>b     <span class="pl-c"><span class="pl-c">--</span> a tight infix occurrence</span>
a <span class="pl-k">!</span>b    <span class="pl-c"><span class="pl-c">--</span> a prefix occurrence</span>
a<span class="pl-k">!</span> b    <span class="pl-c"><span class="pl-c">--</span> a suffix occurrence</span></pre><div class="">This distinction is *not* just made by example, but that proposal (which has been accepted) defines these precisely. So, the comments on this thread about what counts as a naked selector are addressed: a naked selector is one where the dot is a prefix occurrence.</div><div class=""><br class=""></div><div class="">Other whitespace-wariness comes from worrying about the distinction between prefix and tight infix occurrences. That is, should we differentiate between the interpretation of `f r.x` and `f r .x`. Yet in all versions of any of this, we differentiate between loose infix and the others. Thus there is *always* whitespace-sensitivity around dot. Note that this is true, as Simon PJ pointed out, regardless of this proposal, where a tight-infix usage of a dot with a capitalized identifier on the left is taken as a module qualification. In all of its versions, this proposal *increases* the whitespace sensitivity, by further distinguishing between prefix occurrences of dot and other usages.</div><div class=""><br class=""></div><div class="">Let's compare options 3 and 5 with this analysis then:</div><div class=""><br class=""></div><div class="">Option 3:</div><div class="">loose-infix: whatever (.) is in scope</div><div class="">tight-infix:</div><div class="">  - if left-hand is a capitalized identifier: module qualification</div><div class="">  - otherwise: record selection, binding tighter than function application</div><div class="">prefix: postfix record selection, binding like function application</div><div class="">suffix: presumably, whatever (.) is in scope</div><div class=""><br class=""></div><div class="">Option 5:</div><div class="">loose-infix: whatever (.) is in scope</div><div class="">tight-infix:</div><div class=""> - if left-hand is a capitalized identifier: module qualification</div><div class=""> - otherwise: postfix record selection, binding like function application</div><div class="">prefix: postfix record selection, binding like function application</div><div class="">suffix: presumably, whatever (.) is in scope</div><div class=""><br class=""></div><div class="">My point here is that option (5) is no more or less whitespace sensitive than option (3). Both need the same cases to figure what the period character in your code means. I think this is why Simon PJ has keyed this part of the debate to module qualification: that existing feature (not under debate) essentially breaks the symmetry here, meaning that we have more room to work with without breaking symmetry further.</div><div class=""><br class=""></div><div class="">My vote is thus:</div><div class=""><br class=""></div><div class="">3 > 5 > 2 > 4 > 1</div><div class=""><br class=""></div><div class="">Other points of motivation:</div><div class="">- Despite my argument above, I see the merit in (5). I just think that an argument "we don't want dot to be whitespace-sensitive" isn't really effective.</div><div class="">- I want to accept this proposal. We're not going to get another go at this.</div><div class="">- I really don't like the way record-update binds, and (4) reminds me too much of that.</div><div><br class=""></div><div>Richard</div><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 10, 2020, at 9:58 AM, Simon Marlow <<a href="mailto:marlowsd@gmail.com" class="">marlowsd@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Fri, 7 Feb 2020 at 22:37, Joachim Breitner <<a href="mailto:mail@joachim-breitner.de" class="">mail@joachim-breitner.de</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class="">I really would prefer a design where all these questions do not even<br class="">need to be asked…<br class=""></blockquote><div class=""><br class=""></div><div class="">Me too. Also what about (.x) vs. ( .x), are those the same?<br class=""></div><div class=""> <br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">So I think to have the full picture, we need the following option as<br class="">well on the ballot:<br class=""><br class=""> 5. .x is a postfix operator, binding exactly like application,<br class="">    whether it is naked or not.<br class="">    (This is option 3, but without the whitespace-sensitivity.)<br class=""></blockquote><div class=""> <br class=""></div><div class="">[...]<br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Anyways, now for my opinion: Assuming no more options are added, my<br class="">ranking will be<br class=""><br class=""> <span class="Apple-converted-space"> </span>5 > 4 > 2 > 1 > 3<br class=""><br class="">This puts first the two variants where .x behaves like an existing<br class="">language feature (either like function application or like record<br class="">updates), has no whitespace sensitivity, and follows existing languages<br class="">precedence (JS and OCaml, resp.).<br class="">Then the compromise solution that simply forbids putting spaces before<br class="">.x (so at least the program doesn't change semantics silently).<br class="">I dislike variant 3, which adds a _new_ special rule, and where adding<br class="">a single space can change the meaning of the program, so I rank that<br class="">last.<br class=""></blockquote><div class=""><br class=""></div><div class="">I'm also against whitespace-sensitivity and I lean towards this ordering too.</div>But I'm going with:<br class=""><div class=""><br class=""></div><div class="">5 > 2 > 1 > 4 > 3</div></div><div class="gmail_quote"><div class=""><br class=""></div><div class="">Rationale: (5) seems the easiest to explain and has the fewest special cases, yet covers the use-cases we're interested in. Beyond that I want to be conservative because I find it hard to predict the ramifications of the more-complex alternatives 4/3, so I've put 2/1 ahead of those. I've made my peace with the current record selection syntax binding more tightly than application, and indeed I often rely on it to avoid a $, so I'm OK with 4 over 3.</div><div class=""><br class=""></div><div class="">Cheers</div><div class="">Simon</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class=""><br class="">Cheers,<br class="">Joachim<br class=""><br class=""><br class="">PS, because its on my mind, and just for fun:<br class=""><br class="">Under variant 3, both foo1 and foo2 typecheck, they do quite different<br class="">things (well, one loops).<br class=""><br class=""> <span class="Apple-converted-space"> </span>data Stream a = Stream { val :: a, next :: Stream a }<br class=""><br class=""> <span class="Apple-converted-space"> </span>foo1 f s = Stream (s.val) (foo1 (fmap f s).next)<br class=""> <span class="Apple-converted-space"> </span>foo2 f s = Stream (s.val) (foo2 (fmap f s) .next)<br class=""><br class=""><br class="">--<span class="Apple-converted-space"> </span><br class="">Joachim Breitner<br class=""> <span class="Apple-converted-space"> </span><a href="mailto:mail@joachim-breitner.de" target="_blank" class="">mail@joachim-breitner.de</a><br class=""> <span class="Apple-converted-space"> </span><a href="http://www.joachim-breitner.de/" rel="noreferrer" target="_blank" class="">http://www.joachim-breitner.de/</a><br class=""><br class=""><br class="">_______________________________________________<br class="">ghc-steering-committee mailing list<br class=""><a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@haskell.org</a><br class=""><a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br class=""></blockquote></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">ghc-steering-committee mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:ghc-steering-committee@haskell.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">ghc-steering-committee@haskell.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a></div></blockquote></div><br class=""></div></body></html>