putStr

2003-10-13 Thread Jose Morais
Hi, What I needed was actualy something more like f3 :: Int -> String f3 x = show x ++ f4 x f4 :: Int -> IO String f4 x = do putStr ("initial value is " ++ show x) return (show x) but this gives the error Type checking ERROR "teste.hs":11 - Type error in applicat

putStr

2003-10-13 Thread Jose Morais
Hi, I am trying to something like f1 :: Int -> Int f1 x = f2 x f2 :: Int -> Int f2 x = 2 * x but before f2 returns its result I'd like it to print something like "The initial value is " ++ show x. How could I do this? Thank you __

Re: global variable

2003-10-12 Thread Jose Morais
Sorry the newbie question and the insistence, but how exactly do I use map or fold applied to the infinite list to get successive integers at each time? Thank you ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/li

global variable

2003-10-12 Thread Jose Morais
Hello, I need a function called, say, newItem, that when first called returns 1, the next time it is called it would return 2, then 3 and so on. How can I achieve this? Thank you ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://w