Oh ye Haskell wizards. Is the following program syntactically legal
or not?
x = let a = let { b=1;
c=2
} in 3
in 4
I.e. is the layout rule from an outer scope in effect even inside
explicit brackets?
Here's another
x = let a = let
in 3
in 4
OK, what happens? First we insert an lcurl after the first let and
remember the indentation (8). Then the second let will get an lcurl
at indentation 3 (position of in). But 3 is less than 8 so there also be
an rcurl from the first let. The last in will have an rcurl inserted because
otherwise we would have a syntax error. So we get
x = let { a = let
{}in 3
}in 4
This is a correct program, but the curls in the empty let were not inserted
by matching constructs!!
-- Lennart & Niklas