[Haskell-cafe] Can type be changed along a >>= chain?

Niklas Broberg niklas.broberg at gmail.com
Mon Oct 12 12:43:50 EDT 2009


On Mon, Oct 12, 2009 at 6:37 PM, michael rice <nowgate at yahoo.com> wrote:

> transform :: IO ()
> transform = putStrLn "What is your digit string?"
>          >> getLine
>          >>= \str -> return ('9':str)
>          >>= \str -> return (read str :: Int)
>          >>= \i -> putStrLn $ "The number is " ++ show i
>
This code works perfectly for me. What problem are you seeing specifically?
Cheers,
/Niklas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091012/8ce5a1c1/attachment.html


More information about the Haskell-Cafe mailing list