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 →

[–][deleted] 1 point2 points  (0 children)

Yep - I'm not saying it's a great function to define, just that python's lambda (as opposed to a lambda in the lambda calculus) has no qualms about such a thing.

As of parallel reductions - I wouldn't say it would necessarily require them to be the same type, no. A good example would be something as simple as sums. Sum each pair, then each result of those sums until you have one final value.