[Haskell-cafe] Type error in final generator

2007-12-08 Thread Loganathan Lingappan
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

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Bryan O'Sullivan
Loganathan Lingappan wrote: main = do hSetBuffering stdin LineBuffering numList - processInputs foldr (+) 0 numList The type of main is understood to be IO (), so it can't return anything. You could work around this by rewriting the last line above as follows: print

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Derek Elkins
On Sat, 2007-12-08 at 16:39 -0800, Bryan O'Sullivan wrote: Loganathan Lingappan wrote: main = do hSetBuffering stdin LineBuffering numList - processInputs foldr (+) 0 numList The type of main is understood to be IO (), so it can't return anything. You could

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Loganathan Lingappan
Thanks Bryan and Derek. This works! Logo - Original Message From: Derek Elkins [EMAIL PROTECTED] To: Bryan O'Sullivan [EMAIL PROTECTED] Cc: Loganathan Lingappan [EMAIL PROTECTED]; haskell-cafe@haskell.org Sent: Saturday, December 8, 2007 4:53:54 PM Subject: Re: [Haskell-cafe] Type error