In python I can do:
filter(lambda x: x%2==0, xrange(10))
Is this basically the same concept? filter(lambda x: x%2==0, xrange(10))
Is this basically the same concept?Unlike those traditional functions, however, transducer versions are composable. So I can put a whole bunch of maps, reducers, and filters in a row, and assign that composition to a variable. Then I can apply that composition to any type of collection and know that it only requires one pass.
EDIT: _part_ of the appeal. The other is concisely describing things like takeWhile in a way that's both polymorphic and doesn't require multiple implementations. Good refactor motivation in general, happens to have the above property, which is good.