RE: Exhaustive Pattern-Matching
I have a question about pattern-matching. In the Haskell-report it is not postulated, that pattern matching has to be exhaustive. Would it be possible at all to implement an algorithm, which checks Haskell-style patterns for exhaustiveness? What kinds of complication can be expected? Maybe you have some pointers to other resources about this topic.
GHC tries to do so, but sometimes gets it wrong. See the -fwarn-incomplete-patterns flag. We'd appreciate it if someone could overhaul this code - it's been on the wish list for a long time. Cheers, Simon
G'day all. On Wed, Aug 27, 2003 at 04:57:27PM +0100, Simon Marlow wrote:
GHC tries to do so, but sometimes gets it wrong. See the -fwarn-incomplete-patterns flag. We'd appreciate it if someone could overhaul this code - it's been on the wish list for a long time.
As a matter of curiosity, do you have some examples as to when GHC gets it wrong? (We can move this to glasgow-haskell-users if you like.) Cheers, Andrew Bromage
participants (2)
-
Andrew J Bromage -
Simon Marlow