[Haskell-cafe] Monad Description For Imperative Programmer

Seth Gordon sethg at ropine.com
Wed Aug 8 14:02:44 EDT 2007

Kim-Ee Yeoh wrote:
> Seth Gordon wrote:
>> Functors are a generalization from lists to "things that can be mapped
>> over" in general, and then monads are a generalization of functors.
> Way to go! That way lies true co/monadic enlightenment.

I feel like I still don't understand comonads.  Maybe I just need a Zen 
comaster to hit me with a costick and then I'll become coenlightened.

>> Haskell solves the "how can I do I/O in a pure functional language"
>> problem by *turning the world inside-out*.  Instead of taking data from
>> the mutable outside world, using functions to manipulate it, and
>> depositing results back into that world, you put your functions into the
>> IO monad.
> But (the illusion of) taking data out from the real world, manipulating it,
> and then putting it back is exactly what the monadic-do syntax sugar
> accomplishes:

The type system turns the world inside-out and then the do-notation 
provides a right-side-in syntax to code functions in the inside-out world.

More information about the Haskell-Cafe mailing list