On 8/2/07, Seth Gordon <[EMAIL PROTECTED]> wrote:
> 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.

That's a very interesting perspective. One of the questions often
asked by Haskell newcomers is "how do I turn an IO a into an a?". The
correct answer is that you don't; instead, you use a function (a -> m
b) to indicate what you would have done with that a, and the bind
operator takes care of the messy details for you.


Stuart
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to