|
|
|
|
|
by ufo
3871 days ago
|
|
> How would you do that with map and filter functions without looping over the entire (inexhaustible) sequence? But isn't this just a matter of defining map and filter over a lazy stream datatype (aka iterators) instead of over lists? So the workflow would be list -> stream -> filter1 -> filter2 -> list
This would let you run the filters "in parallel" without iterating through things twice. |
|
This is the piece your workflow example would need to take into account. How could I apply a filter followed by something that takes 3 passing values from an infinite sequence? I'm sure you could come up with a way, and it would be worth comparing to the transducer approach :).
(it's worth noting that currying map, filter, etc.. are very complimentary to the transducer approach)