Hi, I am working through Hal Daume's tutorial, trying to do the exercises. I can't figure out how to output an integer with putStrLn (or any other way), I think I need an Int -> [Char] conversion but couldn't find it. Specifically, in Exercise 3.10, I have the product of numbers in pp, and would like to do putStrLn ("Product: " ++ convertnumbertostring(pp)) but I don't know which function does this... Sorry for the extremely dumb question. Thanks, Tamas
Tamas K Papp <tpapp@Princeton.EDU> writes:
Hi,
I am working through Hal Daume's tutorial, trying to do the exercises. I can't figure out how to output an integer with putStrLn (or any other way), I think I need an Int -> [Char] conversion but couldn't find it. Specifically, in Exercise 3.10, I have the product of numbers in pp, and would like to do
putStrLn ("Product: " ++ convertnumbertostring(pp))
but I don't know which function does this...
You could try Hoogle <URL: http://haskell.org/hoogle/ >, though entering Int -> [Char] isn't very helpful, if you put in Int -> String, you get 'show' as the second hit, and that's the function you want. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk
Hi,
You could try Hoogle <URL: http://haskell.org/hoogle/ >, though entering Int -> [Char] isn't very helpful,
A known "issue", Hoogle 4 will know about [Char] = String, and will also be tweaked to give show first in this instance. Thanks Neil
Neil Mitchell wrote:
Hi,
You could try Hoogle <URL: http://haskell.org/hoogle/ >, though entering Int -> [Char] isn't very helpful,
A known "issue", Hoogle 4 will know about [Char] = String, and will also be tweaked to give show first in this instance.
Thanks
Neil _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
You can use show :: (Show a) => a -> String
participants (5)
-
ivan gomez rodriguez -
Jared Updike -
Jón Fairbairn -
Neil Mitchell -
Tamas K Papp