[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / misc / examples / io / io007 / Main.hs
diff --git a/ghc/misc/examples/io/io007/Main.hs b/ghc/misc/examples/io/io007/Main.hs
new file mode 100644 (file)
index 0000000..d6c94d8
--- /dev/null
@@ -0,0 +1,6 @@
+main =
+    openFile "io007.in" ReadMode >>= \ hIn ->
+    hPutStr hIn "test" `handle`
+    \ (IllegalOperation _) -> 
+        hGetContents hIn >>= \ stuff ->
+        hPutStr stdout stuff