Paste number 6027: error in my attempt to use getLine

Paste number 6027: error in my attempt to use getLine
Pasted by: metaperl
When:4 years, 4 months ago
Share:Tweet this! | http://paste.lisp.org/+4NF
Channel:#haskell
Paste contents:
Raw Source | XML | Display As
module Main 
    where 
 
import IO 
 
 
ask_for_numbers = do 
  hSetBuffering stdin LineBuffering 
  putStrLn "Enter natural numbers, 0 to stop" 
  getLine 
 
main = 
  num <- ask_for_numbers -- <== program fails here 
  case num of 
           0 -> [] 
           _ -> num : main 
                 
 
 
sum  = foldr (+) 0 
prod = foldr (*) 0 
 
factorial n  
  | n <= 0  = 1 
  | n >  0  = n * factorial (n-1) 

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.