The H98 report says:
exp -> case exp of { alts }
alts -> alt1 ; ... ; altn (n>=1)
alt -> pat -> exp [where decls]
| pat gdpat [where decls]
| (empty alternative)
Since an alt can be empty, these ought to be legal:
case e of { }
case e of { ; }
However, GHC 5.04.2 rejects them ("parse error on input `}'"). The
report also says:
A case expression must have at least one alternative and each
alternative must have at least one body.
But this "at least one body" rule, if strictly interpreted, seems to
contradict the "empty alternative" production. And anyway GHC accepts
this:
case e of { _ -> e; ; }
which clearly contains several empty alternatives. So I don't see why a
case expression consisting of _only_ empty alternatives couldn't be
accepted.
(No, I don't claim this to be particularly useful for anything. :)
Lauri Alanko
[EMAIL PROTECTED]
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs