Hi,
Could someone please tell me how to check this program. The problem is where do I find the output? I laod this into ghc and it comes up OK modules loaded: Main
gchi>
How do I now check if it works or see the result.
Program below (taken from real world haskell)
-- file: ch07/toupper-imp.hs
import System.IO
import Data.Char(toUpper)
main :: IO ()
main = do
inh <- openFile "quux.txt" ReadMode
outh <- openFile "output.txt" WriteMode
mainloop inh outh
hClose inh
hClose outh
mainloop :: Handle -> Handle -> IO ()
mainloop inh outh =
do ineof <- hIsEOF inh
if ineof
then return ()
else do inpStr <- hGetLine inh
hPutStrLn outh (map toUpper inpStr)
mainloop inh outh
John