<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello guys!<div><br></div><div>A deadline of a discusssion on this has been reached. To review the discussion you can&nbsp;<a href="http://haskell.1045720.n5.nabble.com/A-single-general-modification-function-for-Map-and-IntMap-proposal-td5729524.html">visit the archives</a>. Following is a summarization.</div><div><br></div><div>1. Following is an implementation proposed by Schachaf Ben-Kiki, which in a combination with an `INLINABLE` pragma produces very impressive results by making even the primitive operations reimplemented in terms of it perform better:</div><div><br></div><div>insert: ~ +5% increase using alterF<br>delete: ~ +10% increase using alterF<br></div><div><br></div><div><font face="Menlo">&nbsp; &nbsp;alterF :: (Ord k, Functor f) =&gt; k -&gt; (Maybe a -&gt; f (Maybe a)) -&gt;&nbsp;Map k a -&gt; f (Map k a)<br>&nbsp;&nbsp;&nbsp;STRICT_1_OF_2(alterF)<br>&nbsp;&nbsp;&nbsp;alterF k f = go<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;go Tip = maybe Tip (singleton k) &lt;$&gt; f Nothing<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;go (Bin sx kx x l r) =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case compare k kx of<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LT -&gt; (\l' -&gt; balance kx x l' r) &lt;$&gt; go l<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GT -&gt; (\r' -&gt; balance kx x l r') &lt;$&gt; go r<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EQ -&gt; maybe (glue l r) (\x' -&gt; Bin sx kx x' l r) &lt;$&gt; f (Just x)<br></font></div><div><br></div><div>2. `alterF` seems to be a mutually accepted title for the function</div><div><br></div><div>3. There was one downvote for implementing `alterF` with a changed&nbsp;order of parameters to "key -&gt; lambda", as compared to&nbsp;"lambda -&gt; key" of other modification functions in the library.&nbsp;Others seemed to be neutral about it. The implementation above is in that changed order. After some thinking my vote can be counted as a downvote too on that.</div><div><br></div><div>4. People seem to be indifferent to functions `insertLookupWithKey` and `updateLookupWithKey`, concerning their deprecation. The other proposed functions from the list following, however, generally are not wished to deprecate:&nbsp;insertWith, insertWithKey, adjust, adjustWithKey, update, updateWithKey, alter.</div><div><br></div><div>Best regards,</div><div>Nikita Volkov</div></body></html>