From de972178542ba92993942f74de43408d10860252 Mon Sep 17 00:00:00 2001
From: panne <unknown>
Date: Sun, 9 Jul 2000 16:00:55 +0000
Subject: [PATCH] [project @ 2000-07-09 16:00:55 by panne] By definition (sec.
 7.3 in the H98 report), userError raises an IOError, so Prelude.catch should
 catch UserError exceptions, too. Apart from not conforming to the report,
 without this patch GHC's typechecker falls straight on its face.

---
 ghc/lib/std/PrelException.lhs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ghc/lib/std/PrelException.lhs b/ghc/lib/std/PrelException.lhs
index b1f41e7b20f7..29f7edbab78e 100644
--- a/ghc/lib/std/PrelException.lhs
+++ b/ghc/lib/std/PrelException.lhs
@@ -1,5 +1,5 @@
 % ------------------------------------------------------------------------------
-% $Id: PrelException.lhs,v 1.22 2000/07/07 11:03:58 simonmar Exp $
+% $Id: PrelException.lhs,v 1.23 2000/07/09 16:00:55 panne Exp $
 %
 % (c) The University of Glasgow, 1998-2000
 %
@@ -53,6 +53,7 @@ catchException (IO m) k =  IO $ \s -> catch# m (\ex -> unIO (k ex)) s
 catch           :: IO a -> (Exception -> IO a) -> IO a 
 catch m k	=  catchException m handler
   where handler err@(IOException _) = k err
+        handler err@(UserError   _) = k err
 	handler other               = throw other
 \end{code}
 
-- 
GitLab