1 import LibDirectory (removeFile)
4 openFile "io008.in" ReadMode >>= \ hIn ->
5 openFile "io008.out" ReadWriteMode >>= \ hOut ->
6 removeFile "io008.out" >>
7 hGetPosn hIn >>= \ bof ->
11 hSeek hOut AbsoluteSeek 0 >>
12 hGetContents hOut >>= \ stuff ->
15 copy :: Handle -> Handle -> IO ()
17 try (hGetChar hIn) >>=
18 either (\ EOF -> return ()) ( \ x -> hPutChar hOut x >> copy hIn hOut)