Proposal: Performance improvements for Data.IntMap
igloo at earth.li
Fri Sep 3 12:11:40 EDT 2010
On Tue, Aug 31, 2010 at 03:09:34AM -0700, Donald Bruce Stewart wrote:
> #4279: Proposal: Performance improvements for Data.IntMap
Same .Internals comment as for Data.Map in #4277.
> - | zero k m -> let (found,l') = insertLookupWithKey f k x l in (found,Bin p m l' r)
> - | otherwise -> let (found,r') = insertLookupWithKey f k x r in (found,Bin p m l r')
> + | zero k m = case go l of (found, l') -> (found,Bin p m l' r)
> + | otherwise = case go r of (found, r') -> (found,Bin p m l r')
I noticed you didn't convert the let's to case's in Data.Map, in both
insertLookupWithKey and insertLookupWithKey'. Why did you convert them
in IntMap's insertLookupWithKey but not Map?
Unrelated to your changes, but I think it would be worth renaming
foldr' (an internal helper) to avoid confusion.
More information about the Libraries