Simon explains why my three examples are in fact okay:
| > >f a b c =
| > > defs x
| > > where
| > > x = ...
|
| That's fine, the new layout rule doesn't change the parsing of this
| definition. Remember, the outer syntax level starts with the 'f', the inner
| level with the 'x ='.
| [... etc ...]
Which all goes to show that the clarification of the previously
ambiguous rule is not as clear as hoped. :-) Sorry to bother
everyone with a non-bug.
| Admittedly it's a little tricky to implement this stuff properly, but I
| believe the next version of GHC does so. Feel free to prove me wrong :)
Tricky to understand too, but I think I've got it now.
| f x = x where
| g x = x
I think this is a good example to illustrate what the rule disallows.
Unfortunately, the example given in the Report is nothing like as clear
- in fact, I still don't understand it. Perhaps someone could explain
it to me?
> f x = let
> h y = let
> p z = z
> in p
>in h
> Here, the definition of p is indented less than the indentation of the
> enclosing context, which is set in this case by the definition of h.
To me, it looks like it is not the *definition* of p that is indented
less, but the *use*. Is that right?
Regards,
Malcolm