<div dir="ltr">Given the fragility of rewrite rules (and the fact that they don't happen at all at the default optimization level) that seems too delicate of a solution to endorse.<div><br></div><div>That doesn't prevent us from adding the rewrite rules to try to help existing code that already uses <font face="monospace, monospace">filter (`S.member` set)</font>, in addition to these combinators, though. That idiom is already rather common given the lack of an alternative to date and improving its performance wouldn't hurt.<br><div><br></div><div>-Edward</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 25, 2016 at 6:05 PM, Joachim Breitner <span dir="ltr"><<a href="mailto:mail@joachim-breitner.de" target="_blank">mail@joachim-breitner.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
Am Montag, den 25.07.2016, 14:59 -0400 schrieb David Feuer:<br>
> Both `restrictKeys` and `withoutKeys` are special cases of<br>
> `filterWithKey` (although they should be considerably more efficient<br>
> than implementations using that function).<br>
<br>
</span>I’m risking to derailing this discussion, but how viable would it be to<br>
*not* add a new exported name for this, but recommend (e.g. in the<br>
docs) to use<br>
<br>
filter (`S.elem` set) map<br>
<br>
and then rely on rewrite rules to get the desired performance effect<br>
(by rewriting this expression to an non-exported restrictKeys)?<br>
<br>
I guess the answer is: Not viable enough, because rewrite rules are not<br>
applied reliably enough, and because you cannot easily have the effect<br>
of a partial "map `restrictKeys`". But nevertheless it is an<br>
interesting idea to imagine a programming language where APIs can be<br>
minimal, modular and composable without performance penalties.<br>
<br>
Greetings,<br>
<div class="HOEnZb"><div class="h5">Joachim<br>
<br>
<br>
<br>
<br>
--<br>
Joachim “nomeata” Breitner<br>
<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a> • <a href="https://www.joachim-breitner.de/" rel="noreferrer" target="_blank">https://www.joachim-breitner.de/</a><br>
XMPP: <a href="mailto:nomeata@joachim-breitner.de">nomeata@joachim-breitner.de</a> • OpenPGP-Key: 0xF0FBF51F<br>
Debian Developer: <a href="mailto:nomeata@debian.org">nomeata@debian.org</a></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>