[Haskell-beginners] Empty 'do' constructor

Sok H. Chang shaegis at gmail.com
Sat Sep 25 03:21:37 EDT 2010


Thank you to your answer!
I indent me code as you said.
I tried using Tab, using spaces…
But can't work.

Is there another possibility?
Thank you!

- Chang.

2010. 9. 25. 오후 1:49 Brent Yorgey <byorgey at seas.upenn.edu> 작성:

> On Sat, Sep 25, 2010 at 01:43:33PM +0900, Sok H. Chang wrote:
>> I use Haskell Platform 2010.2.0.0 on WinXP, and jEdit.
>> I write my first code, and got error...
>>
>> main = do cs <- readFile "C:\\SPR.txt"
>> putStrLn $ myManupulation cs
>>
>> myManupulation cs = (unlines cs) ! 3
>
> Because putStrLn is not indented it is not considered part of the
> do-block.  You should line it up under the stuff after the 'do',
> like this:
>
>  main = do cs <- readFile "C:\\SPR.txt"
>            putStrLn $ myManupulation cs
>
> -Brent
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners


More information about the Beginners mailing list