<p dir="ltr">Fine. Sounds like I lose this one. Should the duals be mapAntitone and mapKeysAntitone?</p>
<div class="gmail_quote">On Jul 12, 2016 1:44 AM, "Edward Kmett" <<a href="mailto:ekmett@gmail.com">ekmett@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm also slightly biased against renaming, as the intent is signaled pretty clearly.<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 6:12 AM, Andreas Abel <span dir="ltr"><<a href="mailto:abela@chalmers.se" target="_blank">abela@chalmers.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I thought the current functions are quite clear with a bit of common sense. They assume the renaming of keys does not change their relative order, so the underlying tree structure of the map/set can remain as-is.<br>
<br>
Of course, as you point out, the names are not precise, but cannot the documentation add what is not reflected in the names?<br>
<br>
The question is, as always, if the breakage caused by the renaming compensates for having the optimal name. I am slightly biased against the renaming.<br>
<br>
--Andreas<span><br>
<br>
<br>
On 09.07.2016 02:28, David Feuer wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
<br>
On Jul 8, 2016 7:18 PM, "Ivan Lazar Miljenovic"<br></span><span>
<<a href="mailto:ivan.miljenovic@gmail.com" target="_blank">ivan.miljenovic@gmail.com</a> <mailto:<a href="mailto:ivan.miljenovic@gmail.com" target="_blank">ivan.miljenovic@gmail.com</a>>> wrote:<br>
><br>
> On 9 July 2016 at 03:49, David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a><br></span><span>
<mailto:<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>>> wrote:<br>
<br>
> > Data.Set: mapStrictlyIncreasing and mapStrictlyDecreasing<br>
> > Data.Map: mapKeysStrictlyIncreasing and mapKeysStrictlyDecreasing<br>
><br>
> With the latter function also flipping the underlying tree structure?<br>
<br>
I'm not quite sure what you mean, but I think the answer is yes.<br>
<br>
mapKeysStrictlyDecreasing (\x -> -x) (fromList [1..10]) === fromList<br>
[(-10) .. (-1)]<br>
<br>
><br>
> > Data.Map presents another possibility, however. We could make the<br>
> > replacements more general, giving them types<br>
> ><br>
> > Ord k => (k -> v -> (k', v')) -> Map k v -> Map k' v'<br>
> ><br>
> > and allowing the user to map over both keys and values in one pass.<br>
><br>
> Though IIUC this provides no way of specifying that "I'm sure this<br>
> function has a 1-1 monotonic relationship so you can just update the<br>
> keys without changing the structure" (in the sense of there's no way<br>
> to distinguish between the increasing and decreasing sense).<br>
<br>
That is the pre-condition. There still needs to be one for strictly<br>
increasing functions and another for strictly decreasing ones, since<br>
they lead to reversed tree structures.<br>
<br>
><br>
> Overall, I'm about +0.5 from the naming sense of the current<br>
> functions, but have used these in the past.<br>
<br>
I don't understand this statement.<br>
<br>
<br>
<br></span><span>
_______________________________________________<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-bin/mailman/listinfo/libraries</a><br>
<br>
</span></blockquote><span><font color="#888888">
<br>
<br>
-- <br>
Andreas Abel <>< Du bist der geliebte Mensch.<br>
<br>
Department of Computer Science and Engineering<br>
Chalmers and Gothenburg University, Sweden<br>
<br>
<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a><br>
<a href="http://www2.tcs.ifi.lmu.de/~abel/" rel="noreferrer" target="_blank">http://www2.tcs.ifi.lmu.de/~abel/</a></font></span><div><div><br>
_______________________________________________<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-bin/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div>