There are a number of other data types in that module that have a similar construction IIRC, such as AssertionFailed, NoMethodError, PatternMatchFail, RecConError, RelSelError, etc. which should probably pick up Eq, Ord for consistency (and become newtypes).
On 27/11/12 10:59, Simon Hengel wrote:Already did it, a few weeks ago:
Hi,
I propose to add an Eq instance for ErrorCall. The main motivation is
to make it more convenient to construct predicates that select specific
exceptions.
My current use case is testing for expected exceptions. In Hspec[1] we
use predicates for that, e.g.:
evaluate (head []) `shouldThrow` (== ErrorCall "Prelude.head: empty list")
But I think it can be useful in other situations and it is consistent
with the fact that other common exception types have an Eq instance
(e.g. ArithException, IOException, ExitCode).
Discussion period: 3 Weeks
http://www.haskell.org/pipermail/cvs-libraries/2012-October/016043.html
Cheers,
Simon
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries