check for exhaustive patterns is broken
Marcin 'Qrczak' Kowalczyk
qrczak at knm.org.pl
Mon Feb 11 10:03:33 EST 2002
Mon, 11 Feb 2002 15:30:55 +0100, Feliks Kluzniak <feliks at crt.se> pisze:
> Surely, the properties of "<", ">" and "==" are such that the
> compiler can see there are no other cases?
No. First, they can be defined for some type such that they aren't
exhaustive. Second, compilers aren't that smart to infer all possible
consequences that theoretically are true.
I would replace the last guard with 'otherwise'. Ghc as a special
case knows that it always succeeds and won't issue a warning.
--
__("< Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
\__/
^^
QRCZAK
More information about the Glasgow-haskell-bugs
mailing list