<div dir="ltr">I've needed argmin and argmax a few times. In at least one of the cases I remember, I was implementing some algorithm that was specified with argmax in pseudocode, so those names make sense to me.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 27, 2016 at 1:30 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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, May 27, 2016 at 3:02 PM, Edward Kmett <span dir="ltr"><<a href="mailto:ekmett@gmail.com" target="_blank">ekmett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Note: in general we have chosen to supply By methods, rather than On methods, because he on combinator can be used to get one in terms of the other. We explicitly added sortOn because it can use a Schwartzian transform to be more efficient than sortBy (comparing `on` f).<br>
<br>
These don't have direct analogues there, however. So that usual argument against adding these sorts of methods doesn't hold up.<br>
<br>
One thing of note is that what you are asking for here is usually called argmin and argmax. Perhaps consistency with the rest of mathematics should trump consistency with sortOn.<br>
<br>
IIRC, We already have Arg in Data.Semigroup for use with the Min and Max semigroups for this purpose, so such naming would fit.<br></blockquote><div><br></div></span><div>I'm not particularly concerned about the names that we decide. I just used those names because I thought they were intuitive for the current community. I'm happy with any other names that make sense.</div></div></div></div>
<br>_______________________________________________<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-bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>