Proposal for template-haskell: Make Q an instance of Applicative

Michael Snoyman michael at snoyman.com
Fri Jul 8 12:33:14 CEST 2011


On Fri, Jul 8, 2011 at 12:56 PM, Bas van Dijk <v.dijk.bas at gmail.com> wrote:
> Hello,
>
> The Q type:
>
> newtype Q a = Q { unQ :: forall m. Quasi m => m a }
>
> currently has an instance for Monad and Functor. I would like to
> propose adding an instance for Applicative as well. Note that this
> also means that the Quasi class needs to get an Applicative
> superclass:
>
> class (Monad m, Applicative m, Functor m) => Quasi m where ...
>
> Discussion period: 2 weeks.
>
> Regards,
>
> Bas
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>

+1. But wouldn't it be possible to do this without the Applicative
superclass, using the Monad instance? Not saying we *should* do that,
I'm in favor of your proposal exactly as-is.

Michael



More information about the Libraries mailing list