nikic / iter

Iteration primitives using generators
Other
1.12k stars 76 forks source link

reductions(), intermediate values of a reduction #23

Closed igorw closed 9 years ago

igorw commented 9 years ago

reductions() is quite similar to reduce(). However, instead of only returning the final result, it will yield every accumulated value along the way.

This is taken from clojure's reductions() function:

nikic commented 9 years ago

Nice!