From f460a89b3e089dcf47c67ed747687b91dd80d5fd Mon Sep 17 00:00:00 2001
From: sewardj <unknown>
Date: Tue, 15 Feb 2000 11:24:20 +0000
Subject: [PATCH] [project @ 2000-02-15 11:24:20 by sewardj] In
 hugsprimRunIO_toplevel, use catchException instead of catch. At least
 exceptions can then be caught, although Hugs then goes on to die with an
 assertion failure in unblockAsyncExceptionszh_ret_entry, probably caused by
 wrongly entering it twice in immediate succession.

---
 ghc/lib/std/PrelHugs.lhs | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/ghc/lib/std/PrelHugs.lhs b/ghc/lib/std/PrelHugs.lhs
index 23a106fe3295..6df8cc60eade 100644
--- a/ghc/lib/std/PrelHugs.lhs
+++ b/ghc/lib/std/PrelHugs.lhs
@@ -32,7 +32,7 @@ import PrelNum
 import PrelReal(Integral)
 import Prelude(fromIntegral)
 import IO(putStr,hFlush,stdout,stderr)
-import PrelException(catch)
+import PrelException(catch,catchException)
 import PrelIOBase(IO,unsafePerformIO)
 import PrelShow(show,shows,showString,showChar,Show,ShowS)
 import PrelRead(Read,ReadS,lex,reads)
@@ -129,12 +129,11 @@ hugsprimRunIO_toplevel m
            = primCatch (protect (n-1) comp)
                        (\e -> fst (unST (putStr (show e ++ "\n")) realWorld))
 -}
+
 hugsprimRunIO_toplevel :: IO a -> ()
 hugsprimRunIO_toplevel m
-   = unsafePerformIO (
-        catch (m >> hFlush stderr >> hFlush stdout)
-              (\e -> putStr (show e ++ "\n"))
-     )
-
-
+    = unsafePerformIO (
+         catchException (m >> hFlush stderr >> hFlush stdout)
+                        (\e -> putStr ("error: " ++ show e ++ "\n"))
+      )
 \end{code}
\ No newline at end of file
-- 
GitLab