Proposal: Add foldrWithIndex and foldlWithIndex to Data.List

Ganesh Sittampalam ganesh at earth.li
Wed Oct 22 19:13:38 UTC 2014


On 16/10/2014 18:14, David Feuer wrote:
> These functions can be lifted pretty much straight out of Data.Sequence.
> In particular, foldrWithIndex makes for a particularly nice expression
> of a fusing findIndices function, as is present in Data.Sequence.

Do these do anything better than just adding indicies first with the 
standard zip [0..] idiom?

Cheers,

Ganesh



More information about the Libraries mailing list