I think I misspoke, the docs of reduce says that
It is unspecified whether init is used for non-empty collections.
I would recommend foldr / foldl instead for code that is not meant to be parallelized — it guarantees that init will be used.
I think I misspoke, the docs of reduce says that
It is unspecified whether init is used for non-empty collections.
I would recommend foldr / foldl instead for code that is not meant to be parallelized — it guarantees that init will be used.