<div dir="ltr">They'd all act the same assuming any or all of the instances existed, but GHC can't backtrack and figure out which way to get there, it'll only look at the instance head.<div><br>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 11, 2015 at 2:22 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oh, I see... you get horrible overlap problems there. Blech! I guess<br>
they'll all act the same (modulo optimized <$ and such), but GHC can't<br>
know that and will see them as forever incoherent.<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Sep 11, 2015 at 1:52 PM, Edward Kmett <<a href="mailto:ekmett@gmail.com">ekmett@gmail.com</a>> wrote:<br>
> Actually it is trickier than you'd think.<br>
><br>
> With "Functor" you can pretend that contravariance doesn't exist.<br>
><br>
> With both profunctor and contravariant it is necessarily part of the puzzle.<br>
><br>
> data Compose f g a = Compose (f (g a))<br>
><br>
> * are both f and g contravariant leading to a functor?<br>
> * is f contravariant and g covariant leading to a contravariant functor?<br>
> * is f covariant and g contravariant leading to a contravariant functor?<br>
><br>
> data Wat p f a b = Wat (p (f a) b)<br>
><br>
> is p a Profunctor or a Bifunctor? is f Contravariant or a Functor?<br>
><br>
> We investigated adding TH code-generation for the contravariant package, and<br>
> ultimately rejected it on these grounds.<br>
><br>
> <a href="https://github.com/ekmett/contravariant/issues/17" rel="noreferrer" target="_blank">https://github.com/ekmett/contravariant/issues/17</a><br>
><br>
> -Edward<br>
><br>
><br>
><br>
> On Fri, Sep 11, 2015 at 12:49 PM, David Feuer <<a href="mailto:david.feuer@gmail.com">david.feuer@gmail.com</a>> wrote:<br>
>><br>
>> Would it be possible to add mechanisms to derive Contravariant and<br>
>> Profunctor instances? As with Functor, each algebraic datatype can<br>
>> only have one sensible instance of each of these.<br>
>><br>
>> David Feuer<br>
>> _______________________________________________<br>
>> ghc-devs mailing list<br>
>> <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>