On Fri, Sep 3, 2010 at 5:07 PM, Ian Lynagh <span dir="ltr"><<a href="mailto:igloo@earth.li">igloo@earth.li</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Sun, Aug 29, 2010 at 06:15:45AM -0700, Donald Bruce Stewart wrote:<br>
Also, could the tests module be made -Wall clean, and compiled with<br>
-Wall? That way it is harder to accidentally not run a test, by defining<br>
it but not adding it to the list of tests.<br></blockquote><div><br>If the proposal is accepted we can -Wall clean the code before submitting.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
> +{-# DEPRECATED fold "Use foldrWithKey instead" #-}<br>
> +{-# DEPRECATED foldWithKey "Use foldrWithKey instead" #-}<br>
<br>
I didn't expect to see DEPRECATED pragmas being added in the middle of a<br>
patch called "Performance improvements to Data.Map"!<br>
<br>
Why have these been deprecated?<br></blockquote><div><br>They were already deprecated in the Haddock comments so I took the liberty to add a deprecate pragma. If people disagree with this we could remove them.<br> </div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
> +{-<br>
> +-- | /O(log n)/. A strict version of 'insertLookupWithKey'.<br>
> +insertLookupWithKey' :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k<br>
> a<br>
> + -> (Maybe a, Map k a)<br>
> +insertLookupWithKey' f kx x = kx `seq` go<br>
> + where<br>
> + go Tip = x `seq` (Nothing, singleton kx x)<br>
> + go (Bin sy ky y l r) =<br>
> + case compare kx ky of<br>
> + LT -> let (found, l') = go l<br>
> + in (found, balance ky y l' r)<br>
> + GT -> let (found, r') = go r<br>
> + in (found, balance ky y l r')<br>
> + EQ -> let x' = f kx x y in x' `seq` (Just y, Bin sy kx x' l<br>
> r)<br>
> +{-# INLINE insertLookupWithKey' #-}<br>
> +-}<br>
<br>
Why has this new function been added, but commented out?<br></blockquote><div><br>These should have been in a separate patch (see separate ticket for adding those).<br><br>-- Johan<br><br></div></div>