Hi,
I am new to Haskell. I wrote the following code:
module Main
where
import IO
main = do
hSetBuffering stdin LineBuffering
numList <- processInputs
foldr (+) 0 numList
processInputs = do
putStrLn "Enter a number:"
strNum <- getLine
let num = read strNum
if num == 0
then return
[]
else do
rest <- processInputs
return (num : rest)
And am getting the following errors:
ERROR "Ex310.hs":6 - Type error in final generator
*** Term : foldr (+) 0 numList
*** Type : Integer
*** Does not match : IO a
Any pointers to the source of this error would be appreciated.
Thanks,
Logo