diff options
Diffstat (limited to 'ghc/misc/examples/io/io007/Main.hs')
-rw-r--r-- | ghc/misc/examples/io/io007/Main.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ghc/misc/examples/io/io007/Main.hs b/ghc/misc/examples/io/io007/Main.hs new file mode 100644 index 0000000000..d6c94d8ef7 --- /dev/null +++ b/ghc/misc/examples/io/io007/Main.hs @@ -0,0 +1,6 @@ +main = + openFile "io007.in" ReadMode >>= \ hIn -> + hPutStr hIn "test" `handle` + \ (IllegalOperation _) -> + hGetContents hIn >>= \ stuff -> + hPutStr stdout stuff |