<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>+1 to the function, +1 to 'restrictKeys' or 'intersectKeys'</div><div><br></div><div>Tom</div><div><br></div><div><br>El 14 jul 2016, a las 11:01, Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com">iavor.diatchki@gmail.com</a>> escribió:<br><br></div><blockquote type="cite"><div><div dir="ltr">I've also needed this in the past, so +1.<div><br></div><div>I think the bike-shed should be colored: intersectKeys or restrictKeys<br></div><div><br></div><div>-Iavor</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 14, 2016 at 6:39 AM, 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"><div dir="ltr">+1 on the functionality, not a fan of the name.<div><br></div><div>Bikeshed color: intersectionWithSet?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Edward</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 14, 2016 at 9:36 AM, Ivan Lazar Miljenovic <span dir="ltr"><<a href="mailto:ivan.miljenovic@gmail.com" target="_blank">ivan.miljenovic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 14 July 2016 at 22:45, Jake McArthur <<a href="mailto:jake.mcarthur@gmail.com" target="_blank">jake.mcarthur@gmail.com</a>> wrote:<br>
> I like the function, but I'd like to bikeshed a bit. The name "restriction"<br>
> seems confusing to me, or at least I don't understand the etymology. As of<br>
> now I'd prefer something like "filterMember". filterMember is to (filter .<br>
> flip member) as concatMap is to (concat . map). That's not perfectly<br>
> consistent due to the flip, but I think it's close enough to motivate the<br>
> name.<br>
<br>
</span>More possible bikeshed colours:<br>
<br>
* intersectionWith/setIntersection to reflect the similarity with the<br>
existing intersection functions<br>
<br>
* restrictTo (which may fit better with the proposed argument order<br>
than the ones above)<br>
<br>
If we keep this argument order, then I think a name similar to<br>
restriction as originally proposed makes more sense than an<br>
intersection one (as the arguments are flipped compared to the other<br>
similarly named functions).<br>
<div><div><br>
><br>
><br>
> On Thu, Jul 14, 2016, 5:39 AM Andreas Abel <<a href="mailto:abela@chalmers.se" target="_blank">abela@chalmers.se</a>> wrote:<br>
>><br>
>> +1.<br>
>><br>
>> On 14.07.2016 06:45, David Feuer wrote:<br>
>> > Cale Gibbard proposes the following:<br>
>> ><br>
>> > Data.IntMap.restriction :: IntSet -> IntMap a -> IntMap a<br>
>> > Data.Map.restriction :: Ord k => Set k -> Map k a -> Map k a<br>
>> ><br>
>> > In each case, the map is filtered to contain only the keys that are<br>
>> > also found in the set. This can be implemented efficiently using a<br>
>> > slightly stripped-down version of Data.Map.intersection.<br>
>> ><br>
>> > David Feuer<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>
>> ><br>
>><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><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>
><br>
><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>
><br>
<br>
<br>
<br>
--<br>
</div></div><span>Ivan Lazar Miljenovic<br>
<a href="mailto:Ivan.Miljenovic@gmail.com" target="_blank">Ivan.Miljenovic@gmail.com</a><br>
<a href="http://IvanMiljenovic.wordpress.com" rel="noreferrer" target="_blank">http://IvanMiljenovic.wordpress.com</a><br>
</span><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>
</div></div></blockquote></div><br></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>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Libraries mailing list</span><br><span><a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a></span><br><span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a></span><br></div></blockquote></body></html>