scan or accumulate is the operation that takes an array, and returns an array where each element is the sum (or some other operation) of that element, and all the previous elements. It could be spelled similar to reduce
right now.
[1, 2, 3, 4, 5].scan(+) -> [1, 3, 6, 10, 15]
i find myself reaching for this a lot, and am always surprised it’s not in the standard library. a lot of other people reach for it too. does this clear the bar for inclusion in the standard library?