Open ubolonton opened 9 years ago
Interesting. I don't think that violates any of the transducers semantics. I'll merge in your PR and test a few things to make sure it's ok.
It's also worth mentioned that we do more work in take
now, which might be a perf hit, so just need to benchmark and make sure it's not too bad.
This is probably not very important for collections. For js-csp channels, it would make quite a difference.
For example, in the current
take
implementation, if there is atake(5)
channel, it can only close after 6 puts, not 5.More generally speaking, is there a problem with having a class of transducers that reduces and terminates in the same step? Like this