Proposal: Add functions to get consecutive elements to Data.List

Johan Holmquist holmisen at
Wed Apr 13 05:45:54 UTC 2016

Yes, mapAdjacent is mentioned in the linked feature request.

But simply importing does not help, because one also need to manage another
dependency in the project then. Adding another dependency is a rather big
deal, so if one only needs a single, simple function from a package one
will have to consider whether to add that dependency or just define the
function in the project's utility module. Also one first had to find out
about the utility-ht library and its definition of mapAdjacent.

I am proposing inclusion into base to make it readily available out of the
box. I think it would fit rather well together with the other zips in

2016-04-12 23:01 GMT+02:00 Henning Thielemann <lemming at

> On Tue, 12 Apr 2016, Johan Holmquist wrote:
>     zipConsecutivesWith :: (a -> a -> b) -> [a] -> [b]
>>     zipConsecutivesWith f xs = zipWith f xs (tail xs)
> I call it mapAdjacent in my utility-ht package:
> You could simply import that one.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list