fix transducer composition problems, add tests#510
Merged
thomasmulvaney merged 1 commit intopixie-lang:masterfrom Mar 15, 2016
Merged
fix transducer composition problems, add tests#510thomasmulvaney merged 1 commit intopixie-lang:masterfrom
thomasmulvaney merged 1 commit intopixie-lang:masterfrom
Conversation
remove `preserving-reduced` from several transducers. This was modifying the reducing function passed to the transducer, causing reduced values to be wrapped in `reduced` twice, so the reducing process wasn't completely unwrapping reduced values when finishing. Reducing functions only need to be wrapped with `preserving-reduced` if they call `reduce` themselves. (Like `cat` and `pixie.io.common/stream-reducer`) Also fixes a problem with the `take` transducer consuming one more element than needed. Add tests for these problems.
thomasmulvaney
added a commit
that referenced
this pull request
Mar 15, 2016
fix transducer composition problems, add tests
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove
preserving-reducedfrom several transducers. This was modifyingthe reducing function passed to the transducer, causing reduced values
to be wrapped in
reducedtwice, so the reducing process wasn'tcompletely unwrapping reduced values when
finishing. Reducing functions only need to be wrapped with
preserving-reducedif they callreducethemselves. (Likecatandpixie.io.common/stream-reducer)For example
would not return the expected result of
[2 3]Also fixes a problem with the
taketransducer consuming one moreelement than needed.
Add tests for these problems.