[Haskell-cafe] Convert IO Int to Int

Jorge Branco Branco Aires jadrian at mat.uc.pt
Tue Jun 9 15:15:33 EDT 2009

Bulat Ziganshin wrote:
> Hello jerzy,
> Tuesday, June 9, 2009, 8:23:04 PM, you wrote:
>> Please, tell him first about random streams, which he can handle without
>> IO. Or, about ergodic functions (hashing contraptions which transform ANY
>> parameter into something unrecognizable). When he says : "I know all that",
>> THEN hurt him badly with monads. 
> i think that for someone coming from imperative programming teeling
> about IO monad is the easiest way. and then he will learn how to do it
> FP way
I came from a imperative programming background. I didn't feel like this 
help me at all back then. At least in the beginning you want to detach 
yourself from an imperative style, not try to simulate it with some 
weird structure that you don't really understand.

More generally I really wish IO hadn't been the first Monad I played 
with. It's so close to a Functor, yet in my mind Functors were simple, 
just structures that could be mapped, and Monads were these mysterious 
things that allowed you to get away with side effects and that once you 
were inside you could never get out.


More information about the Haskell-Cafe mailing list