[Haskell-beginners] Parse error. Please, Help me.

Magnus Therning magnus at therning.org
Mon Dec 13 15:34:11 CET 2010


On Mon, Dec 13, 2010 at 14:29, Sok H. Chang <shaegis at gmail.com> wrote:
> 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 = []

That 'let' isn't necessary.

> 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
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>



-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus



More information about the Beginners mailing list