[project @ 1996-07-26 20:58:52 by partain]
[ghc-hetmet.git] / ghc / misc / examples / io / io007 / Main.hs
index d6c94d8..467382f 100644 (file)
@@ -1,6 +1,11 @@
+import IO -- 1.3
+
 main =
     openFile "io007.in" ReadMode >>= \ hIn ->
-    hPutStr hIn "test" `handle`
-    \ (IllegalOperation _) -> 
+    hPutStr hIn "test" `catch`
+    \ err ->
+        if isIllegalOperation err then
         hGetContents hIn >>= \ stuff ->
         hPutStr stdout stuff
+       else
+           error "Oh dear\n"