Add joined(by:)#138
Merged
Merged
Conversation
kylemacomber
reviewed
May 3, 2021
kylemacomber
left a comment
There was a problem hiding this comment.
Top notch work!
So much great stuff here, which I'm sure we'll be able to mine for future additions!
| } | ||
|
|
||
| extension InterspersedMap: Sequence { | ||
| public struct Iterator: IteratorProtocol { |
There was a problem hiding this comment.
I assume this public access control is accidental?
Suggested change
| public struct Iterator: IteratorProtocol { | |
| internal struct Iterator: IteratorProtocol { |
| } | ||
|
|
||
| @inlinable | ||
| public mutating func next() -> Result? { |
There was a problem hiding this comment.
Suggested change
| public mutating func next() -> Result? { | |
| internal mutating func next() -> Result? { |
| } | ||
|
|
||
| @inlinable | ||
| public func makeIterator() -> Iterator { |
There was a problem hiding this comment.
Suggested change
| public func makeIterator() -> Iterator { | |
| internal func makeIterator() -> Iterator { |
| } | ||
|
|
||
| extension EitherSequence: Sequence { | ||
| public struct Iterator: IteratorProtocol { |
Contributor
There was a problem hiding this comment.
Since enum decl is internal, this may also be internal too?
natecook1000
approved these changes
May 30, 2021
Member
natecook1000
left a comment
There was a problem hiding this comment.
Looks great, @timvermeulen! 🎉
Member
|
@swift-ci Please test |
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.
This PR adds 4 ways of joining sequences of sequences with a separator, two of which let you base the separator on the sequences right before and after it:
Also adds the following building blocks internally:
EitherandEitherSequenceFlattenCollectionthat flattens a collection of collections without separatorsInterspersedMapthat maps the sequence's elements and intersperses them with new elements at the same timeChecklist