[Haskell-beginners] Monad problem

René Klačan rene.klacan at gmail.com
Sat Jul 11 20:42:27 UTC 2015


Bob Ippolito, thank you for great explanation! Your suggestion is working.

Marcin Mrotek, thank you for additional info.



On Sat, Jul 11, 2015 at 9:09 PM, Marcin Mrotek <marcin.jan.mrotek at gmail.com>
wrote:

> Hello,
>
> > Does this mean that they do not perform IO, or do IO but "break out
> of" / hide their IO using unsafe or something?
>
> No, monad transformers sort of compose "backwards", that is, if you
> have something like FooT (BarT (IO a)) then after running everything,
> you'll get something in the lines of IO (Bar (Foo a)). That's why IO,
> if it is there at all, must be at the bottom of the stack.
>
> Now, I don't know the library you're using, from the docs it would
> appear that you indeed can runInstagramT without any IO in there, but
> some of the actions defined force this or that constraint, and in
> particular this "getUserAccessTokenURL2" forces (MonadControlBase IO
> m), which is more or less a fancy way of saying that there must be IO
> at the bottom.
>
> Best regards,
> Marcin Mrotek
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150711/a0c250bd/attachment-0001.html>


More information about the Beginners mailing list