Proposal: Significant performance improvements for Data.Map

Ian Lynagh igloo at
Fri Sep 3 16:58:32 EDT 2010

On Fri, Sep 03, 2010 at 06:04:21PM +0200, Johan Tibell wrote:
> On Fri, Sep 3, 2010 at 5:07 PM, Ian Lynagh <igloo at> wrote:
> > > +{-# DEPRECATED fold "Use foldrWithKey instead" #-}
> > > +{-# DEPRECATED foldWithKey "Use foldrWithKey instead" #-}
> >
> > I didn't expect to see DEPRECATED pragmas being added in the middle of a
> > patch called "Performance improvements to Data.Map"!
> >
> > Why have these been deprecated?
> They were already deprecated in the Haddock comments so I took the liberty
> to add a deprecate pragma. If people disagree with this we could remove
> them.

Aha, there's a comment:

-- This is identical to 'foldrWithKey', and you should use that one instead of
-- this one.  This name is kept for backward compatibility.

It's 2 years old, so adding a DEPRECATED pragma sounds reasonable to me.

But I don't see a comment saying fold is deprecated. Do we know anything
about how often folding is done on Maps with and without a key? e.g. any
figures from hackage?


More information about the Libraries mailing list