putStr

Jose Morais jjoao at netcabo.pt
Mon Oct 13 19:32:14 EDT 2003


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 application
*** Expression     : show x ++ f4 x
*** Term           : f4 x
*** Type           : IO String
*** Does not match : [a]


	Can you help me?


	Thank you



More information about the Haskell-Cafe mailing list