Proposal: instance MonadIO Q

David Feuer david.feuer at
Thu Jul 23 18:09:47 UTC 2015

I'm very much in the "Damn the torpedoes; full speed ahead" camp most of
the time, but not here. Transformers is a tiny step up from base. Why would
you make it depend on template haskell rather than the other way around?
On Jul 23, 2015 12:17 PM, "Ryan Scott" < at> wrote:

> Template Haskell currently has runIO :: IO a -> Q a , which allows you
> to run IO actions with a guarantee of IO effects' ordering in a single
> splice (but not necessarily the order in which all the Q splices are
> run). If runIO is indeed a monad morphism, then there is a law-abiding
> MonadIO Q instance that could be added to transformers:
> instance MonadIO Q where
>   liftIO = runIO
> This would be useful for dealing with monad transformer stacks with Q
> as the base monad (for an example, see genifunctors
> (
> ).
> The only catch is that transformers would have to depend on
> template-haskell. I think this would be okay since no quasiquotation
> is involved, but I wanted to hear others' opinions.
> Ryan
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list