Can Specter emit reductions over a lensed collection? E.g. (something-specter [ALL :amount (reducer +)] [{:amount 10.0M} {:amount 20.0M} ...]) => [{:amount 10.0M} {:amount 30.0M} ...]
E.g. w/o Specter:
(reductions
(fn [[latest acc] [when amount]]
[when (+ acc amount)])
[0 0.0M]
(zipmap (range 10) (range 10)))
=> ([0 0.0M] [0 0.0M] [7 7.0M] [1 8.0M] [4 12.0M] [6 18.0M] [3 21.0M] [2 23.0M] [9 32.0M] [5 37.0M] [8 45.0M])
@petrus Could traversed
be what you're after?
Alternatively you might get mileage out of collect
Not an expert myself so no promises