Proposal #2769: Export mapAccumR from Data.Map, Data.IntMap

Ross Paterson ross at
Sat Nov 15 19:01:54 EST 2008

On Tue, Nov 11, 2008 at 11:14:25PM +0200, Matti Niemenmaa wrote:
> Ticket URL:
> Discussion period: 1 week
> The `mapAccumR` function has been written in both the Data.Map and
> IntMap sources but it's commented out and not exported. This seems to
> be an error and I propose that it be simply uncommented.
> The issue can be worked around by using Data.List.mapAccumL on the
> descending list representation of the Map, but that's hardly optimal.

Data.Traversable.mapAccumR also works on maps, but has a different type
(matching the one on lists, and Data.Map.mapAccum).  I would suggest
that mapAccumRWithKey would be a consistent name for this one.

> Seems like a no-brainer to me, hence the short discussion period.

I think a week is too short, even for no-brainers.  People take breaks.

More information about the Libraries mailing list