Proposal: instance MonadIO Q

David Feuer david.feuer at gmail.com
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" <ryan.gl.scott at gmail.com> 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
> (
> https://github.com/danr/genifunctors/blob/4677bb57423b1b380ce9b50cc3d765a5c49a957a/Data/Generics/Genifunctors.hs#L47
> ).
> 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 haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150723/5c95bdcb/attachment.html>


More information about the Libraries mailing list