On 26/11/2009 11:50, Ian Lynagh wrote:
Wed Nov 25 15:19:01 PST 2009  Ian Lynagh<[email protected]>
   * Fix a bug in alternative layout rule

     M ./compiler/parser/Lexer.x +1

Great that you've implemented this. Are you planning to do a proposal for Haskell 2011?

I recall there were a few examples that this rule doesn't cope with:

> g = (let x, y :: Int; (x,y) = (1,2) in x, 3)

There's no way to tell that the first comma should not close the layout introduced by the 'let', but the second one should.

> f xs = [ do x | x <- xs ]

here, the vertical bar should close the do, but it doesn't.

Probably would be a good idea to add these to the test suite so we don't forget about them.

It doesn't particularly bother me that the simpler rule can't handle some of the obscure cases. What bothers me more is that I'm not sure that the proposed rule is more understandable as a specification. It is definitely easier to implement, but we need a simple way to explain layout to the programmer.

Cheers,
        Simon

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to