&gt; On Wed, Aug 01, 2007 at 05:29:19PM -0700, Conal Elliott wrote:<br>&gt; &gt; Sadly, this solution runs into the problem of instance selection based only<br>&gt; &gt; on head-matching, not back-chaining into constraints.&nbsp; For instance, I&#39;d
<br>&gt; &gt; like also to use the following &quot;conflicting&quot; declaration.<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; instance (Applicative f, Monoid a) =&gt; Monoid (f a) where<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mempty&nbsp; = pure mempty<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mappend = liftA2 mappend
<br><br>&gt; No quotes - [] is both Applicative and Monoid.&nbsp; Should [String]<br>&gt; [&quot;ab&quot;,&quot;cd&quot;] `mappend` [&quot;ef&quot;,&quot;gh&quot;] give [&quot;ab&quot;,&quot;cd&quot;,&quot;ef&quot;,&quot;gh&quot;] or
<br>&gt; [&quot;abef&quot;,&quot;abgh&quot;,&quot;cdef&quot;,&quot;cdgh&quot;]?<br><br>&gt; Sure enough - a genuine conflict.&nbsp; Thanks for the simple counter-example, Stefan.<br><br>&gt; &gt; What&#39;s the state of thinking &amp; doing with regard to universally quantified
<br>&gt; &gt; class constraints?<br>&gt; &gt;<br>&gt; &gt; Note that hereditary Harrop formulas do include universally quantified<br>&gt; &gt; goals.&nbsp; Less ambitiously, I think GHC&#39;s type-checker already deals with<br>
&gt; &gt; universally-quantified variables, so perhaps quantified constraints are not<br>&gt; &gt; a great reach (just guessing).<br><br>&gt; It&#39;s something I&#39;ve wanted... Got a link for hereditary Harrop formulas
<br>&gt; so I can add them to my to-implement-when-Qhc-is-good-enough list?<br>&gt; Google isn&#39;t telling me much about them except how to add support for<br>&gt; constaints, which isn&#39;t terribly helpful.<br><br>In addition to the &quot;uniform proofs&quot; paper Jeff P mentioned, here&#39;s a paper that describes a progression of interpreters in ML, including HHFs.&nbsp; The culmination is a somewhat efficient implementation of a language very like LambdaProlog.
<br><br>&nbsp;&nbsp;&nbsp; <a href="http://citeseer.ist.psu.edu/elliott90semifunctional.html">http://citeseer.ist.psu.edu/elliott90semifunctional.html</a><br><br>Cheers, - Conal