How come reduce() doesn't work on empty collection...
# stdlib
d
How come reduce() doesn't work on empty collections? Shouldn't it just return seed value?
s
how would that work? reduce on a
Collection<T>
usually returns
T
t
should return the seed value of the reduce
d
yeah, brainfarted, I meant seed value
t
looks like they just prohibit it, perhaps a semantic thing
use fold instead I guess
it takes a seed unlike reduce
s
lol yeah, there isn’t a seed value to return with reduce
💯 1
t
yup realized my error right after I said it
d
yeah, ok I completely brainfarted