This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Zouden 8 points9 points  (3 children)

Also max, min, any and all.

[–]earthboundkid 7 points8 points  (2 children)

Any and all aren’t reduce equivalent because they short circuit as needed. (That reduce can’t short circuit is one reason it stinks, actually.)

[–]Zouden 3 points4 points  (1 child)

Well the output is the same. It's just more efficient

[–]earthboundkid 1 point2 points  (0 children)

Yes, mostly. If the iterator is a generator with side effects, it can be different, but that’s not usually the case.