<div dir="ltr">I find Contravariant functors to be a nice abstraction. +1 on this.<div><br></div><div>- Sid<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 13, 2017 at 11:08 AM, Aloïs Cochard <span dir="ltr"><<a href="mailto:alois.cochard@gmail.com" target="_blank">alois.cochard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi there,<div><br></div><div>Just to say I'm all for it as well, wanted that in base a few time in the past...</div><div><br></div><div>Cheers</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On 13 September 2017 at 15:13, 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"><div dir="ltr">I am +1 on this. Like others, I also only want Data.Functor.Contravariant, not the rest of the machinery in there. As a historical data point, I proposed this a year ago (<a href="http://haskell.1045720.n5.nabble.com/Move-Data-Functor-Contravariant-into-base-td5847730.html" target="_blank">http://haskell.1045720.n5.nab<wbr>ble.com/Move-Data-Functor-Cont<wbr>ravariant-into-base-td5847730.<wbr>html</a>), but the we ended up on a tangent why a DeriveContravariant wouldn't really be possible, and the original proposal went nowhere. So, as a piece of advice, don't talk about DeriveContravariant ;)</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-1940244204020802703h5">On Tue, Sep 12, 2017 at 5:44 PM, Daniel Díaz Casanueva <span dir="ltr"><<a href="mailto:dhelta.diaz@gmail.com" target="_blank">dhelta.diaz@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-1940244204020802703h5"><div dir="ltr">Dear haskellers,<div><br></div><div>I admit I might not have the strongest arguments here, but I thought that I would share my opinion anyway, and maybe get other people's perspectives. I would like to propose bringing the Contravariant class [1] to base.</div><div><br></div><div>I know, base keeps growing, and maybe there is no need for it to grow further without a strong argument, but I do feel like Contravariant is a simple, very basic class, that would receive better and greater use if included in base. Contravariant is very similar to Functor (some people call it CoFunctor), but in `contramap` (Contravariant's `fmap`) the "arrow" of the applied function goes in the opposite direction. I think that `contramap` can be useful for many types, just like `fmap` is for many others, but we don't use it because it's not yet so popular, or maybe because it requires the contravariant package to be included as dependency (although personally I don't think that is a real problem). The contravariant package itself provides a plentiful of instances, many of them for types in base.</div><div><br></div><div>In a real world scenario I had, it was very useful to add a Contravariant instance to `Data.Aeson.ToJSONKeyFunction`<wbr>, that perhaps is not included in aeson because either it was not desired to add the contravariant package as dependency, or simply because Contravariant is not so well-known. Note that, however, `FromJSONKeyFunction` _is_ instance of Functor. Even though both instances are equally natural and useful in this context, only one of them was implemented. This probably would not have happened if Contravariant was in base.</div><div><br></div><div>So, in my opinion, for the sake of completeness, I think we should add Contravariant to base, just as we have Functor. Note that my proposal does not necessarily include the rest of types and functions defined in the contravariant package.</div><div><br></div><div>Best regards,</div><div>Daniel Casanueva</div><div><br></div><div># References</div><div><br></div><div>[1] <a href="http://hackage.haskell.org/package/contravariant-1.4/docs/Data-Functor-Contravariant.html#t:Contravariant" target="_blank">http://hackage.haskell.org<wbr>/package/contravariant-1.4/doc<wbr>s/Data-Functor-Contravariant.h<wbr>tml#t:Contravariant</a></div></div>
<br></div></div><span>______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">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-bi<wbr>n/mailman/listinfo/libraries</a><br>
<br></span></blockquote></div><span class="m_-1940244204020802703HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-1940244204020802703m_6128659062304695623gmail_signature" data-smartmail="gmail_signature">-Andrew Thaddeus Martin</div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">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-bi<wbr>n/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div><div class="m_-1940244204020802703gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><b>Λ\oïs</b></div><div><div><a href="http://twitter.com/aloiscochard" target="_blank">http://twitter.com/<wbr>aloiscochard</a></div><div><a href="http://github.com/aloiscochard" target="_blank">http://github.com/aloiscochard</a></div></div></div></div></div></div>
</div>
<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>
<br></blockquote></div><br></div></div></div>