From 0cb35eb65bfdc1b2f4cf8bb96776a5eb02ab0270 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 29 Jan 2002 17:12:53 +0000 Subject: [PATCH] [project @ 2002-01-29 17:12:53 by simonmar] Add instance Eq Exception (and hence instance Eq IOError). --- ghc/lib/std/PrelIOBase.lhs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ghc/lib/std/PrelIOBase.lhs b/ghc/lib/std/PrelIOBase.lhs index ea459d3..51a16dc 100644 --- a/ghc/lib/std/PrelIOBase.lhs +++ b/ghc/lib/std/PrelIOBase.lhs @@ -1,5 +1,5 @@ % ------------------------------------------------------------------------------ -% $Id: PrelIOBase.lhs,v 1.46 2002/01/22 13:54:22 simonmar Exp $ +% $Id: PrelIOBase.lhs,v 1.47 2002/01/29 17:12:53 simonmar Exp $ % % (c) The University of Glasgow, 1994-2001 % @@ -461,6 +461,25 @@ instance Show Exception where showsPrec _ (Deadlock) = showString "<>" showsPrec _ (UserError err) = showString err +instance Eq Exception where + IOException e1 == IOException e2 = e1 == e2 + ArithException e1 == ArithException e2 = e1 == e2 + ArrayException e1 == ArrayException e2 = e1 == e2 + ErrorCall e1 == ErrorCall e2 = e1 == e2 + ExitException e1 == ExitException e2 = e1 == e2 + NoMethodError e1 == NoMethodError e2 = e1 == e2 + PatternMatchFail e1 == PatternMatchFail e2 = e1 == e2 + RecSelError e1 == RecSelError e2 = e1 == e2 + RecConError e1 == RecConError e2 = e1 == e2 + RecUpdError e1 == RecUpdError e2 = e1 == e2 + AssertionFailed e1 == AssertionFailed e2 = e1 == e2 + DynException _ == DynException _ = False -- incomparable + AsyncException e1 == AsyncException e2 = e1 == e2 + BlockedOnDeadMVar == BlockedOnDeadMVar = True + NonTermination == NonTermination = True + Deadlock == Deadlock = True + UserError e1 == UserError e2 = e1 == e2 + -- ----------------------------------------------------------------------------- -- The ExitCode type -- 1.7.10.4