Proposal: keep Data.Map.foldWithKey

Christian Maeder Christian.Maeder at dfki.de
Fri Jan 14 12:32:29 CET 2011


I wouldn't mind the additions even if committed for ghc-7.0.2, but can
we please start deprecations a major release later (and revert the
current spurious deprecation of Data.Map.foldWithKey).

Christian

Am 14.01.2011 12:07, schrieb Ross Paterson:
> On Fri, Jan 14, 2011 at 11:13:31AM +0100, Gregory Collins wrote:
>> hunk ./Data/IntMap.hs 117
>>              -- ** Fold
>>              , fold
>>              , foldWithKey
>> +            , foldlWithKey
>> +            , foldrWithKey
>> +            , foldlWithKey'
>> +            , foldrWithKey'
>>  
>> [...]
>> +{-# DEPRECATED foldWithKey "Use foldrWithKey instead" #-}
> 
> The additions improve consistency between Data.Map and Data.IntMap,
> which is clearly the right thing to do.
> 
> I also believe that deprecating the redundant foldWithKey in both modules
> is also a good first step toward trimming the redundancy from these APIs.
> I would also favour deprecating fold in all four modules in favour of
> Data.Foldable.foldr.



More information about the Libraries mailing list