Yes, I have tried both implementations at the start and solved it by choosing for the following:<div><br class="webkit-block-placeholder"></div><div><div>type family F a :: * -&gt; *</div><div>type FList a x = Either () (a,x)</div>
<div>type instance F [a] = FList a</div><div><br class="webkit-block-placeholder"></div><div>instance (Functor (F [a])) where</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fmap _ (Left _) = Left ()</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>fmap f (Right (a,x)) = Right (a,f x)</div><div><br class="webkit-block-placeholder"></div><div>The option was:</div><div><br class="webkit-block-placeholder">
</div><div><div>type family F a x :: *</div><div>type instance F [a] x = Either() (a,x)</div><div><br class="webkit-block-placeholder"></div><div>instance (Functor (F [a])) where -- error, not enough parameters passed to F</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>fmap _ (Left _) = Left ()</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fmap f (Right (a,x)) = Right (a,f x)</div></div><div><br class="webkit-block-placeholder">
</div><div>So, indeed, with either implementation I have a problem.</div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">&gt;I have my suspicions about your mentioning of both Functor (F d) and<br>
&gt;Functor (F a) in the signature. Which implementation of fmap do you want?<br>&gt;Or should they be both the same (i.e. F d ~ F a)?</span><br></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br class="webkit-block-placeholder">
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">This is an hard question to which the answer is both.</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br class="webkit-block-placeholder">
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">In the definition of an hylomorphism I want the fmap from (F d):</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br class="webkit-block-placeholder">
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><div>hylo :: (Functor (F d)) =&gt; d -&gt; (F d c -&gt; c) -&gt; (a -&gt; F d a) -&gt; a -&gt; c</div><div>hylo d g h = g . fmap (hylo d g h) . h</div>
<div><br class="webkit-block-placeholder"></div><div>However, those constraints I have asked about would allow me to encode a paramorphism as an hylomorphism:</div><div><br class="webkit-block-placeholder"></div><div><div>
class Mu a where</div><div>&nbsp;&nbsp; &nbsp;inn :: F a a -&gt; a</div><div>&nbsp;&nbsp; &nbsp;out :: a -&gt; F a a</div></div><div><br class="webkit-block-placeholder"></div><div><div>para :: (Mu a, Functor (F a),Mu d, Functor (F d),F d a ~ F a (a,a), F d c ~ F a (c,a)) =&gt; d -&gt; (F a (c,a) -&gt; c) -&gt; a -&gt; c</div>
<div>para d f = hylo d f (fmap (id /\ id) . out)</div><div><br class="webkit-block-placeholder"></div><div>In para, I would want the fmap from (F a) but that would be implicitly forced by the usage of out :: a -&gt; F a a</div>
</div></span></div><div><div><div><div><br class="webkit-block-placeholder"></div><div>Sorry for all the details, ignore them if they are too confusing.</div><div>Do you think there might be a definition that would satisfy me both Functor instances and equality?</div>
<div><br class="webkit-block-placeholder"></div><div>Thanks for your pacience,</div><div>hugo</div></div></div></div></div>