Ticket #4261: strict-foldl-with-key.dpatch

File strict-foldl-with-key.dpatch, 3.6 KB (added by tibbe, 4 years ago)
Line 
11 patch for repository http://darcs.haskell.org/libraries/containers:
2
3Wed Aug 18 13:49:39 CEST 2010  Johan Tibell <johan.tibell@gmail.com>
4  * Add strict version of foldlWithKey
5
6New patches:
7
8[Add strict version of foldlWithKey
9Johan Tibell <johan.tibell@gmail.com>**20100818114939
10 Ignore-this: 382cd9b4f85eb14bc76a49bf53fad872
11] {
12hunk ./Data/Map.hs 109
13             , foldWithKey
14             , foldrWithKey
15             , foldlWithKey
16+            , foldlWithKey'
17 
18             -- * Conversion
19             , elems
20hunk ./Data/Map.hs 1460
21 foldlWithKey f z (Bin _ kx x l r) =
22     foldlWithKey f (f (foldlWithKey f z l) kx x) r
23 
24+-- | /O(n)/. Strict version of 'foldlWithKey'.
25+foldlWithKey' :: (b -> k -> a -> b) -> b -> Map k a -> b
26+foldlWithKey' f z0 m = go z0 m
27+  where
28+    go z _ | z `seq` False = undefined
29+    go z Tip               = z
30+    go z (Bin _ kx x l r)  = go (f (go z l) kx x) r
31+{-# INLINE foldlWithKey' #-}
32+
33 {--------------------------------------------------------------------
34   List variations
35 --------------------------------------------------------------------}
36}
37
38Context:
39
40[Set Data.Map's delta to 4; fixes #4242
41Ian Lynagh <igloo@earth.li>**20100815131954]
42[Add a test for #4242
43Ian Lynagh <igloo@earth.li>**20100815131856]
44[Add a local type signature
45simonpj@microsoft.com**20100730124447
46 Ignore-this: b581d3f2c80a7a860456d589960f12f2
47]
48[Add type signature in local where clause
49simonpj@microsoft.com**20100727151709
50 Ignore-this: 5929c4156500b25b280eb414b508c508
51]
52[Fix Data.Sequence's breakr, and add a test for it; fixes trac #4157
53Ian Lynagh <igloo@earth.li>**20100704140627]
54[Fix proposal #4109: Make Data.Map.insertWith's strictness consistent
55Ian Lynagh <igloo@earth.li>**20100615133055]
56[Tweak layout to work with the alternative layout rule
57Ian Lynagh <igloo@earth.li>**20091129154519]
58[Disable building Data.Sequence (and dependents) for nhc98.
59Malcolm.Wallace@cs.york.ac.uk**20091124025653
60 There is some subtlety of polymorphically recursive datatypes and
61 type-class defaulting that nhc98's type system barfs over.
62]
63[Fix another instance of non-ghc breakage.
64Malcolm.Wallace@cs.york.ac.uk**20091123092637]
65[Add #ifdef around ghc-only (<$) as member of Functor class.
66Malcolm.Wallace@cs.york.ac.uk**20091123085155]
67[Fix broken code in non-GHC branch of an ifdef.
68Malcolm.Wallace@cs.york.ac.uk**20091123084824]
69[doc bugfix: correct description of index argument
70Ross Paterson <ross@soi.city.ac.uk>**20091028105532
71 Ignore-this: 9790e7bf422c4cb528722c03cfa4fed9
72 
73 As noted by iaefai on the libraries list.
74 
75 Please merge to STABLE.
76]
77[Bump version to 0.3.0.0
78Ian Lynagh <igloo@earth.li>**20090920141847]
79[update base dependency
80Ross Paterson <ross@soi.city.ac.uk>**20090916073125
81 Ignore-this: ad382ffc6c6a18c15364e6c072f19edb
82 
83 The package uses mkNoRepType and Data.Functor, which were not in the
84 stable branch of base-4.
85]
86[add fast version of <$ for Seq
87Ross Paterson <ross@soi.city.ac.uk>**20090916072812
88 Ignore-this: 5a39a7d31d39760ed589790b1118d240
89]
90[new methods for Data.Sequence (proposal #3271)
91Ross Paterson <ross@soi.city.ac.uk>**20090915173324
92 Ignore-this: cf17bedd709a6ab3448fd718dcdf62e7
93 
94 Adds a lot of new methods to Data.Sequence, mostly paralleling those
95 in Data.List.  Several of these are significantly faster than versions
96 implemented with the previous public interface.  In particular, replicate
97 takes O(log n) time and space instead of O(n).
98 (by Louis Wasserman)
99]
100[Fix "Cabal check" warnings
101Ian Lynagh <igloo@earth.li>**20090811215900]
102[TAG 2009-06-25
103Ian Lynagh <igloo@earth.li>**20090625160202]
104Patch bundle hash:
1052e14405853e2b542aa84cfb1a0948cd2b9e64979