According to my table, we have two prefix `.`s. These are field accesses. Just like the tight infix positioning of `.`. So, (f a .b c .d e) means the exact same thing as (f a.b c.d e), which is, presumably (f (a.b) (c.d) e).

 

So `.x` behaves like a postfix operator with precedence tighter than function application.   Indeed, personally, I don’t like that!

 

Also I realise that it might be good to write

  xs  .map double

      .filter isEven

      .map square

and that would indeed be what you could say with a postfix operator.  It would parse as

  (((xs.map) double).filter isEven).map square

 

Simon

 

From: Richard Eisenberg <rae@richarde.dev>
Sent: 10 December 2019 14:33
To: Simon Peyton Jones <simonpj@microsoft.com>
Cc: Joachim Breitner <mail@joachim-breitner.de>; ghc-steering-committee@haskell.org
Subject: Re: [ghc-steering-committee] RecordDotSyntax: please express a view

 

 



On Dec 10, 2019, at 2:27 PM, Simon Peyton Jones <simonpj@microsoft.com> wrote:

 

|  To be concrete, I propose this:

Not concrete enough.  I don't understand 

|  prefix             with a ( before the .: field selector
|                     otherwise: field access

What does (f a .b c .d e) mean?

 

According to my table, we have two prefix `.`s. These are field accesses. Just like the tight infix positioning of `.`. So, (f a .b c .d e) means the exact same thing as (f a.b c.d e), which is, presumably (f (a.b) (c.d) e).

 

Perhaps that's not what we like. But it is simple and comes straight from my table. And it is not too bad for programmers: prefix `.` is *just like* tight infix `.`. The only exception is at the beginning of a section, where tight-infix does not make sense.

 

Richard