<div dir="ltr">+1, and I like the name "compose".<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 8 Jul 2019 at 06:42, Alexandre Rodrigues <<a href="mailto:alexandreR_B@outlook.com">alexandreR_B@outlook.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>


<div class="gmail-m_-1257745018222105902WordSection1">
<p class="MsoNormal">I can recall having had a need for this function a few times, so that’s cause for a +1 from me.</p>
<p class="MsoNormal">“compose” is not a bad name.</p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-1257745018222105902divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Libraries <<a href="mailto:libraries-bounces@haskell.org" target="_blank">libraries-bounces@haskell.org</a>> on behalf of Elliot Cameron <<a href="mailto:eacameron@gmail.com" target="_blank">eacameron@gmail.com</a>><br>
<b>Sent:</b> Sunday, July 7, 2019 8:28:31 PM<br>
<b>To:</b> Tom Murphy<br>
<b>Cc:</b> Haskell Libraries<br>
<b>Subject:</b> Re: Proposal: composition util for Maps</font>
<div> </div>
</div>
<div>
<div dir="auto">+1 for "compose" and inclusion</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Jul 7, 2019, 2:17 PM <<a href="mailto:amindfv@gmail.com" target="_blank">amindfv@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="auto">
<div></div>
<div>+1 from me on the addition and the name "compose"</div>
<div><br>
</div>
<div>Tom</div>
<div><br>
El 7 jul 2019, a las 13:49, David Feuer <<a href="mailto:david.feuer@gmail.com" rel="noreferrer" target="_blank">david.feuer@gmail.com</a>> escribió:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="auto">
<div>For what it's worth, I'm fairly confident that implementation is optimal, though I don't know how to even try to prove it. The only situation I see where we could obviously do better is when ab maps many keys to the same value and bc is very large compared
 to ab. In that case, it would make sense to store a "cache" of lookups into bc. But the constant factors for such an arrangement would be terrible, and there would be no benefit whatsoever in the general case. So I think the simple thing is the right thing
 here. As for names, I like compose. I support the proposal for the reason Alexandre gives: it feels like a fundamental operation.<br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Jul 7, 2019, 1:22 PM Alexandre Esteves <<a href="mailto:alexandre.fmp.esteves@gmail.com" rel="noreferrer" target="_blank">alexandre.fmp.esteves@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>In <a href="https://github.com/haskell/containers/issues/647" rel="noreferrer noreferrer" target="_blank">https://github.com/haskell/containers/issues/647</a> I proposed the following util:<br>
</div>
<div><br>
</div>
<div>composition :: Ord b => Map b c -> Map a b -> Map a c<br>
composition bc ab = flip mapMaybe ab $ flip lookup bc<br>
<br>
Which has O(|ab| * log |bc|) performance. It's not particularly hard to write, but it does feel like a primitive-ish operation, and it's not obvious to me whether there's a faster implementation.</div>
<div><br>
</div>
<div>Other name suggestions</div>
<div>- (.)</div>
<div>- chain</div>
<div>- compose</div>
<div><br>
</div>
<div><br>
</div>
</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>Libraries mailing list</span><br>
<span><a href="mailto:Libraries@haskell.org" rel="noreferrer" target="_blank">Libraries@haskell.org</a></span><br>
<span><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></span><br>
</div>
</blockquote>
</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote>
</div>
</div>
</div>

_______________________________________________<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>
</blockquote></div>