reductions(), intermediate values of a reduction

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:

 * https://clojuredocs.org/clojure.core/reductions