<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 14, 2018 at 8:49 AM, Akio Takano <span dir="ltr"><<a href="mailto:tkn.akio@gmail.com" target="_blank">tkn.akio@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>I can think of 3 reasonable definitions for (<>) for lazy maps:<br>
<br>
1. (<>) = union<br>
2. (<>) = unionWith (<>)<br>
3. (<>) = Strict.unionWith (<>)<br>
<br>
Of these, (1) is by far the most useful operation in my experience.<br>
(2) has the advantage that it seems like the most obvious choice, but<br>
it's not very useful in practice. (3) is slightly more useful than<br>
(2), but feels less canonical. Also (3) seems inconsistent with how<br>
fmap is defined.<br></blockquote><div><br></div><div>I think you are very much in the minority here. (1) which we have now is almost never what I want. (2) is much more likely to be what I need. And of course, you can recover (1) with (2) by simply mapping First into every element. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
So there doesn't seem to be a clear winner. Perhaps there shouldn't<br>
have been a Monoid instance for maps in the first place. Given that we<br>
already have one, however, it seems that the marginal gain of removing<br>
it doesn't justify the cost of breaking code.<br></blockquote><div><br></div><div>There should be a Monoid instance, and <a href="http://conal.net/papers/type-class-morphisms/">http://conal.net/papers/type-class-morphisms/</a> argues that it should be (2).</div></div><br></div></div>