
4 Nov
2005
4 Nov
'05
2:52 a.m.
On 11/4/05, Abhijit Ray
I wrote the following program and it dint compile. what's wrong with it
module Main where
import IO
main = do hSetBuffering stdin LineBuffering let testList = makeList let sum = foldr (+) 0 testList putStrLn "Sum is " ++ show(sum)
Write either testList <- makeList or sum <- liftM (foldr (+) 0) testList You probably want the former form. BTW, there is a sum function in Haskell prelude. Best regards Tomasz