[Haskell-beginners] Parse error. Please, Help me.
Sok H. Chang
shaegis at gmail.com
Mon Dec 13 15:29:08 CET 2010
Hello, everyone.
I write my second code... but when I compile this, I got an error... (My
first code works. of course, at that time, I got an indentation error, but I
could fix it.)
Haskell>ghc --make Temp.hs -o Temp.exe
[1 of 1] Compiling Main ( Temp.hs, Temp.o )
Temp.hs:7:0: parse error (possibly incorrect indentation)
Temp.hs is made using by jEdit on Window XP.
I install Haskell Platform.
code is ...
import System.IO
import System.Random
let sentenceAry = []
main :: IO ()
main = do inh <- openFile "c:\\Documents and
Settings\\shaegis\\inputFile.txt" ReadMode
outh <- openFile "c:\\Documents and Settings\\shaegis\\outputFile.txt"
WriteMode
mainloop inh outh
hClose inh
hClose outh
mainloop :: Handle -> Handle -> IO ()
mainloop inh outh = do ineof <- hIsEOF inh
if ineof
then do hPutStrLn outh inpStr
return ()
else do inpStr <- hGetLine inh
let sentenceAry = inpStr : []
mainloop inh outh
Please, help me.
Thank you.
Sincerely, Sok Chang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20101213/1f1b1ba3/attachment.htm>
More information about the Beginners
mailing list