[ghc-steering-committee] Precedence of r.x

Joachim Breitner mail at joachim-breitner.de
Thu Dec 12 14:00:30 UTC 2019


Hi,

Am Donnerstag, den 12.12.2019, 12:30 +0000 schrieb Richard Eisenberg:
> I would also like to propose
> 
> (C). Syntax error.
> 
> That is, a tight-infix use of `.` does not associate with a function application on its left. A prefix occurrence of `.` would: `f x .y` would be `(f x) .y`.
> 
> 
> We could also just make this a warning.

such a warning was actually also proposed in the monster GitHub thread:
https://github.com/ghc-proposals/ghc-proposals/pull/282#issuecomment-564597503
as -Wproximity, which could warn about any misleading spacing, so not only
`f x.y` (whether this is a record access or function composition), but also
`x * y+z` etc.

Sounds very nice! Probably orthogonal to this proposal, but maybe a way
to make people worry less about the confusion that `f x.y` may bring?

Cheers,
Joachim

-- 
Joachim Breitner
  mail at joachim-breitner.de
  http://www.joachim-breitner.de/



More information about the ghc-steering-committee mailing list