projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1996-07-26 20:58:52 by partain]
[ghc-hetmet.git]
/
ghc
/
misc
/
examples
/
io
/
io016
/
Main.hs
1
import IO -- 1.3
2
3
import System (getArgs)
4
import Char (toUpper)
5
6
main = getArgs >>= \ [f1,f2] ->
7
openFile f1 ReadMode >>= \ h1 ->
8
openFile f2 WriteMode >>= \ h2 ->
9
copyFile h1 h2 >>
10
hClose h1 >>
11
hClose h2
12
13
copyFile h1 h2 =
14
hIsEOF h1 >>= \ eof ->
15
if eof then
16
return ()
17
else
18
hGetChar h1 >>= \ c ->
19
hPutChar h2 (toUpper c) >>
20
copyFile h1 h2
21