<div dir="ltr"><div>I have no particular issue with moving Contravariant into base.</div><div><br></div>That said, DeriveContravariant doesn't work out as well as you'd think. See the discussion in here: <a href="https://github.com/ekmett/contravariant/issues/17">https://github.com/ekmett/contravariant/issues/17</a> (There were other, longer discussions elsewhere that were er.. more of a discussion, but they were mostly on places like #haskell-lens which aren't logged and I can't find them at the moment.)<div><br>With covariance you can just ignore that contravariant cases exist and get reasonable deriving.<br><br>With contravariance composition of contravariant functors is covariant. You have the f (g a) problem. Which of the two is contravariant? This doesn't arise solely from type arguments. When faced with a concrete data type, you can't just look for a Contravariant or Functor instance for it, because both might be available (think Proxy). So the whole extension becomes a bug-addled mess.<br><br>e.g. There are two sensible Contravariant instances for Compose, but neither one is canonical.<br><div><br></div><div>The other DeriveFoo definitions all do reasonable things. This can't do a reasonable thing in any non-trivial situation.<br></div><div><div><br></div><div>-Edward</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 11, 2016 at 11:14 AM, Andrew Martin <span dir="ltr"><<a href="mailto:andrew.thaddeus@gmail.com" target="_blank">andrew.thaddeus@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The typeclass Contravariant (from the contravariant package) is both<br>
useful and fundamental. I would like to see this moved into base.<br>
One additional motivating factor is that it would become possible<br>
for a DeriveContravariant extension to be written in a future GHC<br>
release. I'd love to hear other people's thoughts, even if it's as<br>
simple as a yea or nay. Thanks.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Andrew Martin<br>
______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
</font></span></blockquote></div><br></div>