running = (fn, init, {subPropertyName} = {}) =>
R.map(
item => {
const operand = subPropertyName ? item[subPropertyName] : item
const result = ({
...operand,
init,
exit: binop(fn, init, operand),
total: init,
})
const objectToReturn = subPropertyName
? ({ ...item, [subPropertyName]: result })
: result
init = result.exit
return objectToReturn
}
)