check for exhaustive patterns is broken
Simon Marlow
simonmar at microsoft.com
Mon Feb 11 10:19:11 EST 2002
> I put this one on the SourceForge bug list in November, but
> there is no
> indication that anyone has noticed it.
Sorry about that, it just didn't receive a high enough priority. In fact, I seem to recall that we were going to fix this by changing the error message from "pattern matches are non-exhaustive" to "pattern matches may be non-exhaustive" if there are guards involved :-)
Marcin is right about it not being possible, even in the special case you quoted involving Ord/Eq operators, to tell whether the matches are exhaustive or not. I suppose we could do it for certain Prelude datatypes, but it just doesn't seem worth it. The workaround using an 'otherwise' clause is easy and may even make your program go faster.
Cheers,
Simon
More information about the Glasgow-haskell-bugs
mailing list