Hi

If you just use Catch (http://www-users.cs.york.ac.uk/~ndm/catch/):

> >  foo x
> >    | x < 0 = ...
> >    | x == 0 = ...
> >    | x > 0 = ...

This gives an error. Something identical to this code is in
Data.FiniteMap, and indeed, when using floats and NaN's (or just silly
Ord classes) you can cause Data.FiniteMap to pattern match error. See
section 6.3 of the draft paper on the Catch website for details.

>     myNot x
>      | x == True  = False
>      | x == False = True

This is determined to be exhaustive.

> as it is (in general) undecidable whether all patterns are covered.

In general, yes. But its possible to do a lot better than GHC's
current warnings (I'm not saying its worth changing, though)

Thanks

Neil
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to