On Fri, Sep 24, 2010 at 7:09 PM, Milan Straka <fox@ucw.cz> wrote:
There are two thinks to sort out: a) add left/right folds, b) add strict
folds.
I therefore propose to:
a) add foldrWithKey and foldlWithKey to IntMap, make foldWithKey
deprecated and synonymous for foldrWithKey.
b) add foldl and foldr to Set and IntSet, make fold deprecated
and synonymous to foldr.
c) add strict variants of left and right folds, namely
Data.Map, Data.IntMap: foldlWithKey' foldrWithKey'
Data.Set, Date.IntSet: foldl', foldr'
Some issues:
- should we really rename fold -> foldr? Maybe we could cla
that fold and foldWithKey are right folds and add only
foldl and foldlWithKey.
- should we really deprecate fold and foldWithKey? It could break
a lot of code.
- adding foldl, foldr, foldl' and foldr' to Set and IntSet is going to
cause a lot of trouble because of shadowing. Maybe some better name?
On the other hand, these are the "right" names.