Applicative instance for template haskell's Q

Bas van Dijk v.dijk.bas at gmail.com
Sun Jan 22 10:49:33 CET 2012


On 22 January 2012 08:00, Antoine Latter <aslatter at gmail.com> wrote:
> On Sun, Jan 22, 2012 at 12:30 AM, Conal Elliott <conal at conal.net> wrote:
>> Any reason not to add an Applicative instance for template haskell's Q
>> (quoting) monad? - Conal

+1

> This came up once before - I think the only downside was that
> Applicative then would have to become a super-class of Quasi.
>
> I've never seen an instance for Quasi aside from Q and IO, but I
> haven't looked either. I'm guessing the breakage from this would be
> slight.

I think so too. And the breakage is easy to fix. Also note that Quasi
already has a Functor super-class:

class (Monad m, Functor m) => Quasi m

Adding Applicative will make it complete.

Bas



More information about the Libraries mailing list