help from the community?

Brian Hulley brianh at
Thu Feb 1 06:40:20 EST 2007

Taral wrote:
> On 1/31/07, Conor McBride <ctm at> wrote:
>> So, as far as Haskell' is concerned, I'd favour forbidding non-empty
>> cases, but only because I favour having some more explicit syntax for
>> empty cases, further down the line.
> I see nothing wrong with "case x of {}", with required braces. The
> layout rule never generates empty braces.

main = do
                a <- do
                            b <- something
                            case b of
                return a

Doesn't the layout rule convert the above to:

main = do { a <- do { b <- something; case b of {}}; return a}
empty braces

In any case I thought the layout rule was supposed to be regarded as just a 
convenience rather than making a distinction between explicit braces and 
braces added by the rule?

Also, can anyone explain why empty case constructs are needed? Why not just 
write undefined?


More information about the Haskell-prime mailing list