Adding scanl'

Evan Laforge qdunkan at gmail.com
Tue Sep 11 20:51:00 CEST 2012


On Tue, Sep 11, 2012 at 11:43 AM, Henning Thielemann
<lemming at henning-thielemann.de> wrote:
> I don't know whether this "scanl'" is of much use. "foldl'" is required
> because we can access its accumulator only after "foldl'" finished. But in
> "scanl'" you can and usually should access the interim accumulator values
> that are contained in the result list.

I use it relatively frequently, e.g. 'intervals = scanl (+) 0 (cycle
[2, 1, 2, 2, 1, 2, 2])'



More information about the Libraries mailing list