[Haskell-cafe] Parse error

Andrew Coppin andrewcoppin at btinternet.com
Sun Jan 17 05:44:39 EST 2010


Daniel Fischer wrote:
> Am Sonntag 17 Januar 2010 11:33:45 schrieb Andrew Coppin:
>   
>> Urg, but that's *ugly*. Is there no way I can reduce the amount of
>> indentation to something more reasonable?
>>     
>
>
> main = do
>   putStrLn "Line 1"
>   putStrLn "Line 2"
>
>   let xs = do
>         x <- [1..10]
>         y <- [1..10]
>         return (x+y)
>
>   print xs
>
> That better?
>   

It's an improvement. It's still not pretty, but I guess that's as good 
as it's going to get...

Maybe this is an instance of Haskell trying to tell me "if you need to 
write a 20-line do-block in the middle of your function, you're doing it 
wrong".



More information about the Haskell-Cafe mailing list