Tim Docker wrote:
These layouts feel a bit artificial to me. I am quite partial to
python's
list syntax - a trailing comma is optional. meaning you can write

    [
       a,
       b,
       c,
    ]

I'm surprised this approach isn't more widespread - Are there reasons
why
haskell syntax could not/should not be defined this way?

I think this would be confusing because it looks like a syntax error - the last element is missing. The advantage of just having comma as a separator is that it allows syntax errors to be detected, whereas making it optional would mean one less error is detected at compile time.

I'll take this opportunity to re-present my hyper-cool syntax proposal for lists ;-) :

   #[
       a
       b
       c

No need for commas or a closing ] because we could just use layout!

Regards, Brian.
--
Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.

http://www.metamilk.com
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to