Repository : ssh://[email protected]/containers On branch : ghc-head Link : http://git.haskell.org/?p=packages/containers.git;a=commit;h=e60634d138fe1170899678f4e5d7bf42c388fae8
>--------------------------------------------------------------- commit e60634d138fe1170899678f4e5d7bf42c388fae8 Author: Milan Straka <[email protected]> Date: Tue Jul 2 21:25:31 2013 +0200 Optimize Map.foldMapWithKey. Use optimalizations from foldMap and traverseWithKey -- associativity and test for leaves. >--------------------------------------------------------------- e60634d138fe1170899678f4e5d7bf42c388fae8 Data/Map/Base.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Data/Map/Base.hs b/Data/Map/Base.hs index 4a1600d..fa2fa6a 100644 --- a/Data/Map/Base.hs +++ b/Data/Map/Base.hs @@ -1884,7 +1884,8 @@ foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m foldMapWithKey f = go where go Tip = mempty - go (Bin _ k v l r) = go l `mappend` f k v `mappend` go r + go (Bin 1 k v _ _) = f k v + go (Bin _ k v l r) = go l `mappend` (f k v `mappend` go r) {-# INLINE foldMapWithKey #-} {-------------------------------------------------------------------- _______________________________________________ ghc-commits mailing list [email protected] http://www.haskell.org/mailman/listinfo/ghc-commits
