-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .interleaveOrdered to combine sorted streams (i.e. "merge-sort") #3110
Conversation
Thanks! Haven't looked at this PR yet but it reminded me of: |
Approach looks good to me (though haven't done a line by line review yet). I lean towards coming up with a different name, as |
Totally agree. While "merge" is associated with concurrency, "zip" usually means a product over original element type, so I think "interleave" is a good verb, what about "interleaveSorted"? |
+1 for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me besides the name bike-shedding. Thanks!
@mpilquist @diesalbla I've updated method name and found a better place for test UPD: Also refactored the implementation to much more readable with ".uncons" |
This combinator must be implemented with |
This reverts commit 9010166.
@mpilquist thank you for the explanation, just reverted the last commit |
An implementation of "merge-sort" merging for two streams of sorted data.
This might be useful in practice when combining streams from different underlying sources.
Discord conversation