patch applied (ghc): Fix a bug in alternative layout rule

Simon Marlow marlowsd at gmail.com
Tue Dec 1 10:11:44 EST 2009


On 01/12/2009 14:27, Ian Lynagh wrote:
> On Tue, Dec 01, 2009 at 09:14:22AM +0000, Simon Marlow wrote:
>>
>> So I think the layout rule should read something like
>>
>>    A layout context can be closed by either
>>      (a) a token indented less than the current indentation level
>>      (b) a closing bracket that matches an open bracket outside the
>>          current layout context
>>
>> where the set of brackets applying to (b) are (), [], {}, and let..in.
>
> And if/then, then/else?

There are lots more things you could consider as brackets, I erred on 
the side of simplicity here.  Not only if/then/else, but also case/of, 
and if we really wanted to be silly we could start adding things like | 
.. = (with commas, for pattern guards).  But I think if the new rule is 
going to be enough of an improvement, it really has to stick to having 
only a few obvious ways to close a layout context.

What I don't know is whether people will accept the new rule in 
practice.  It's hard to remove a feature purely on the grounds of 
complexity, when the complexity doesn't bite that many people (Duncan 
already made this point, I think we could expect similar views from others).

Cheers,
	Simon



More information about the Cvs-ghc mailing list