+1 to adding the Applicative and the constraint on Quasi.<br><br><div class="gmail_quote">On Fri, Jul 8, 2011 at 6:33 AM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Fri, Jul 8, 2011 at 12:56 PM, Bas van Dijk &lt;<a href="mailto:v.dijk.bas@gmail.com">v.dijk.bas@gmail.com</a>&gt; wrote:<br>

&gt; Hello,<br>
&gt;<br>
&gt; The Q type:<br>
&gt;<br>
&gt; newtype Q a = Q { unQ :: forall m. Quasi m =&gt; m a }<br>
&gt;<br>
&gt; currently has an instance for Monad and Functor. I would like to<br>
&gt; propose adding an instance for Applicative as well. Note that this<br>
&gt; also means that the Quasi class needs to get an Applicative<br>
&gt; superclass:<br>
&gt;<br>
&gt; class (Monad m, Applicative m, Functor m) =&gt; Quasi m where ...<br>
&gt;<br>
&gt; Discussion period: 2 weeks.<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Bas<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Libraries mailing list<br>
&gt; <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
&gt;<br>
&gt;<br>
<br>
+1. But wouldn&#39;t it be possible to do this without the Applicative<br>
superclass, using the Monad instance? Not saying we *should* do that,<br>
I&#39;m in favor of your proposal exactly as-is.<br></blockquote><div><br></div><div>Using the Monad constraint only, prevents you from working polymorphically in the Quasi instance while using Applicative combinators. You wind up having to carry around both instances. A burden would be borne by everyone who uses TH, rather than the 2-3 people who write Quasi instances. ;)</div>
<div><br></div><div>-Edward</div></div>