Newbie question

2005-01-09 Thread Dmitri Pissarenko
Hello! I am learning Haskell according to the Yet Another Haskell Tutorial by Hal Daume Ill. One of the exercises involves a) asking the user to enter several numbers (while the end of the sequence is indicated by entering 0) b) calculate the sum of those numbers. The program given below tries

Re: Newbie question

2005-01-09 Thread Einar Karttunen
Dmitri Pissarenko [EMAIL PROTECTED] writes: a) asking the user to enter several numbers (while the end of the sequence is indicated by entering 0) b) calculate the sum of those numbers. ... Here is a corrected version: module Main where import IO Delete this. main = do

Re: Newbie question

2005-01-09 Thread Robert Dockins
comments inline... module Main where import IO main = do hSetBuffering stdin LineBuffering words - askForNumbers printWords words map read words putStrLn The sum is foldl (+) 0 words as you noted map read words is a problematic line. The

Re: Newbie question

2005-01-09 Thread Dmitri Pissarenko
Thanks all for the help! ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

RE: (Stupid?) newbie question

1999-09-01 Thread Sigbjorn Finne (Intl Vendor)
PROTECTED]] Sent: Monday, August 16, 1999 00:45 To: glasgow-haskell-users Subject: (Stupid?) newbie question Hi, folks! I have recently downloaded ghc-4.03 (under win32/cygwin) and everything seems to work great, but somehow the following code snippet does not work as intended: import System