How does "reduce" get started? It appears that it only has a list of A, but its operator needs a B, which it doesn't have?
sirej
It is started with a default initial value depending on the datatype and operation. For adding ints, this value would be 0, and for multiplying ints, this value would be 1. You can think of reduce + being the same as fold 0 +.
How does "reduce" get started? It appears that it only has a list of A, but its operator needs a B, which it doesn't have?