On Mon, 2009-11-30 at 23:30 +0000, Ian Lynagh wrote:
> On Mon, Nov 30, 2009 at 11:05:21PM +0000, Duncan Coutts wrote:
> > On Mon, 2009-11-30 at 17:26 +0000, Ian Lynagh wrote:
> > 
> > > f2 x = x + case () of
> > >            () -> x
> > >            where x = 5
> > 
> > 10, same reason.
> 
> So if you look at f2 from the perspective of someone new to the
> language, given they understand the scoping of f1 and f3, would they
> expect that where binding to scope over the entire RHS rather than just
> the case expression? Maybe it's just me, but I don't think that would
> match my intuition.

They would know that it has to be one or the other. The new person would
reason that the language designers either picked > or >= for column
offset. Which one they picked is something a new person would have to
look up, or just try, or avoid.

>From a casual perspective there's nothing subtle about this case, it
does just look like a question of an arbitrary choice between >= vs >. 
Programmers don't (and do not have to) realise that in reality parsing
this relies on the error rule.

Duncan

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

Reply via email to