[Haskell-beginners] monads do not fit together?

Brandon Allbery allbery.b at gmail.com
Tue Oct 15 13:31:24 UTC 2013


On Tue, Oct 15, 2013 at 5:00 AM, Kees Bleijenberg <
k.bleijenberg at lijbrandt.nl> wrote:

> I wonder, do you always have to create a monadtransformer if your program
> uses 2 kinds of IO?
>

In one sense the answer is "yes"; but the real answer is "that's not how it
works". There is only one IO. Monad transformers allow you to add
functionality on top of it, but at some point you need to do actual I/O in
the IO monad.

One reason it's done this way is that CGIT could in theory be written such
that you could swap out the raw IO monad for something that lets you do
testing.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20131015/28291671/attachment.html>


More information about the Beginners mailing list