1 Aug 2009 13:58
RE: StricterLabelledFieldSyntax
Personally I hate the fact that
f Z {x=3}
parses as
f (Z {a=3})
because even though (as Iavor says) there is only one function application involved, it *looks* as if there
are two.
Equally personally, I think that the presence or absence of white space is a powerful signal to
programmers, and it's a shame to deny ourselves use of it. So I'd be quite happy with *requiring* there to be
no space, thus Z{ x=3 }. If that's tricky to lex, so be it. (Though a token
"BRACE_WITH_NO_PRECEDING_WHITESPACE" might do the job.) But this would be a very
non-backward-compatible change.
Simon
| -----Original Message-----
| From: haskell-prime-bounces@... [mailto:haskell-prime-
| bounces@...] On Behalf Of Ian Lynagh
| Sent: 26 July 2009 21:53
| To: haskell-prime@...
| Subject: Re: StricterLabelledFieldSyntax
|
| On Sun, Jul 26, 2009 at 10:16:28PM +0300, Iavor Diatchki wrote:
| >
| > On Sun, Jul 26, 2009 at 10:01 PM, Isaac
| > Dupree<ml@...> wrote:
| > > Iavor Diatchki wrote:
| > >>
| > >> I am strongly against this change. The record notation works just
| > >> fine and has been doing so for a long time. The notation is really
(Continue reading)
with the white space. Mostly, when
the record fields do not fit on a single line. I tend to write things
like this:
ParseError
{ errorPosition = ..
, errorDescription = ..
}
alternatively:
ParseError {
errorPosition = ..,
errorDescription = ..
}
I think that it would be very odd if these did not work because the
brace had to be next to the constructor without white space. The only
alternative I can see would be to have _two_ different notations for
creating records one with the space that requires parens, and one
without that does not require parens but (at least to me) this looks
like a cludge, and is much more complex than the current situation.
-Iavor
On Sat, Aug 1, 2009 at 2:58 PM, Simon Peyton-Jones<
RSS Feed