<div>Hi,</div>
<div>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</div>
<div>gchi></div>
<div> </div>
<div>How do I now check if it works or see the result.</div>
<div> </div>
<div>Program below (taken from real world haskell)</div>
<div>-- file: ch07/toupper-imp.hs<br>import System.IO<br>import Data.Char(toUpper)</div>
<div><br>main :: IO ()<br>main = do <br> inh <- openFile "quux.txt" ReadMode<br> outh <- openFile "output.txt" WriteMode<br> mainloop inh outh<br> hClose inh<br> hClose outh</div>
<div>mainloop :: Handle -> Handle -> IO ()<br>mainloop inh outh = <br> do ineof <- hIsEOF inh<br> if ineof<br> then return ()<br> else do inpStr <- hGetLine inh<br> hPutStrLn outh (map toUpper inpStr)<br>
mainloop inh outh<br></div>
<div>John</div>