proposal for trailing comma and semicolon

Tillmann Rendel rendel at informatik.uni-marburg.de
Sat May 18 17:23:07 CEST 2013


> Greg Weber wrote:
> I would rather get rid of commas
> altogether (make them optional actually) and just have a newline +
> consistent indentation signal a new list item: coffee-script does that.

That would go well together with allowing extra commas, because in 
explicit block syntax, we can have extra semicolons.

Ben Millwood wrote:
> This looks a bit too much like a GADT to my eyes:
>
> data Point = MkPoint
>      x :: Rational
>      y :: Rational

I fear that this is confusing, because so far, layout is always 
introduced by a keyword. But here, layout is introduced by an 
identifier. I suspect this is also what makes problems below for update 
syntax etc.

> But I suppose pattern-matching, update syntax and so forth would
> probably still have to use explicit braces and commas. That
> inconsistency is probably a bit unpleasant.

I feel that record (definition | matching | literals | update) should 
all use the same syntax.

> I'd say import and export lists at least are probably fine with a
> layout-based rule.

What about list literals?

   items = new-keyword-here
     "red"
     "blue"
     "green"

Again, I don't see how that can work out without introducing a keyword. 
Maybe reusing "data" would work:

   items = data
     "red"
     "blue"
     "green"

:)

   Tillmann



More information about the Haskell-prime mailing list