Wed Apr 21 17:57:22 CDT 2010  wasserman.louis@gmail.com
  * Improved Foldable instance and fold-related rewrite rules for Data.Map

New patches:

[Improved Foldable instance and fold-related rewrite rules for Data.Map
wasserman.louis@gmail.com**20100421225722
 Ignore-this: 84a727887cd85fdd45469e5f1e46f276
] {
hunk ./Data/Map.hs 177
             , valid
             ) where
 
-import Prelude hiding (lookup,map,filter,null)
+import Prelude hiding (lookup,map,filter,null,foldr,foldl)
 import qualified Data.Set as Set
 import qualified Data.List as List
 import Data.Monoid (Monoid(..))
hunk ./Data/Map.hs 183
 import Control.Applicative (Applicative(..), (<$>))
 import Data.Traversable (Traversable(traverse))
-import Data.Foldable (Foldable(foldMap))
+import Data.Foldable (Foldable(foldr, foldl, foldMap))
 #ifndef __GLASGOW_HASKELL__
 import Data.Typeable ( Typeable, typeOf, typeOfDefault
                      , Typeable1, typeOf1, typeOf1Default)
hunk ./Data/Map.hs 1545
 toList :: Map k a -> [(k,a)]
 toList t      = toAscList t
 
+{-# NOINLINE [0] toAscList #-}
 -- | /O(n)/. Convert to an ascending list.
 --
 -- > toAscList (fromList [(5,"a"), (3,"b")]) == [(3,"b"), (5,"a")]
hunk ./Data/Map.hs 1974
   foldMap _f Tip = mempty
   foldMap f (Bin _s _k v l r)
     = foldMap f l `mappend` f v `mappend` foldMap f r
+  foldr f = foldrWithKey (const f)
+  foldl f = foldlWithKey (const . f)
 
 {--------------------------------------------------------------------
   Read
hunk ./Data/Map.hs 2351
   = (sort (nub xs) == [x | (x,()) <- toList (fromList [(x,()) | x <- xs])])
 -}
 
+
+{-# RULES
+	"foldr/Data.Map.elems" forall f z m . List.foldr f z (elems m) = foldr f z m;
+	"foldl/Data.Map.elems" forall f z m . List.foldl f z (elems m) = foldl f z m;
+	"foldr/Data.Map.keys" forall f z m . List.foldr f z (keys m) = foldrWithKey (\ k _ -> f k) z m;
+	"foldl/Data.Map.keys" forall f z m . List.foldl f z (keys m) = foldlWithKey (\ z k _ -> f z k) z m;
+	"foldr/Data.Map.toAscList" forall f z m . List.foldr f z (toAscList m) = foldrWithKey (curry f) z m;
+	"foldl/Data.Map.toAscList" forall f z m . List.foldl f z (toAscList m) = foldlWithKey (curry . f) z m;
+	#-}
}

Context:

[Tweak layout to work with the alternative layout rule
Ian Lynagh <igloo@earth.li>**20091129154519] 
[Disable building Data.Sequence (and dependents) for nhc98.
Malcolm.Wallace@cs.york.ac.uk**20091124025653
 There is some subtlety of polymorphically recursive datatypes and
 type-class defaulting that nhc98's type system barfs over.
] 
[Fix another instance of non-ghc breakage.
Malcolm.Wallace@cs.york.ac.uk**20091123092637] 
[Add #ifdef around ghc-only (<$) as member of Functor class.
Malcolm.Wallace@cs.york.ac.uk**20091123085155] 
[Fix broken code in non-GHC branch of an ifdef.
Malcolm.Wallace@cs.york.ac.uk**20091123084824] 
[doc bugfix: correct description of index argument
Ross Paterson <ross@soi.city.ac.uk>**20091028105532
 Ignore-this: 9790e7bf422c4cb528722c03cfa4fed9
 
 As noted by iaefai on the libraries list.
 
 Please merge to STABLE.
] 
[Bump version to 0.3.0.0
Ian Lynagh <igloo@earth.li>**20090920141847] 
[update base dependency
Ross Paterson <ross@soi.city.ac.uk>**20090916073125
 Ignore-this: ad382ffc6c6a18c15364e6c072f19edb
 
 The package uses mkNoRepType and Data.Functor, which were not in the
 stable branch of base-4.
] 
[add fast version of <$ for Seq
Ross Paterson <ross@soi.city.ac.uk>**20090916072812
 Ignore-this: 5a39a7d31d39760ed589790b1118d240
] 
[new methods for Data.Sequence (proposal #3271)
Ross Paterson <ross@soi.city.ac.uk>**20090915173324
 Ignore-this: cf17bedd709a6ab3448fd718dcdf62e7
 
 Adds a lot of new methods to Data.Sequence, mostly paralleling those
 in Data.List.  Several of these are significantly faster than versions
 implemented with the previous public interface.  In particular, replicate
 takes O(log n) time and space instead of O(n).
 (by Louis Wasserman)
] 
[Fix "Cabal check" warnings
Ian Lynagh <igloo@earth.li>**20090811215900] 
[TAG 2009-06-25
Ian Lynagh <igloo@earth.li>**20090625160202] 
Patch bundle hash:
cc5c8751bda2ece10c3ef250b773de1761003a8d
