-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Add nonmutating rotated and concatenated collection prototypes #3572
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
Conversation
This one is based on ConcatenatedCollection, which concatenates two collections with the same element type.
Is there a reason this isn’t part of the Algorithms prototype? It seems like there will be some interaction(?) |
@swift-ci Please test |
Was there a swift evo proposal for this? I don't like the idea of having the collection type as one of the generic parameters - it means you will get chains like: 'ConcatenatedCollection<ConcatenatedCollection<Array, ContiguousArray>, Array>', which is not very Swift. I'd prefer we wait until generics are more fleshed out, so we can represent this as an abstract "CollectionOf" without leaking details of what types were used to construct it. Edit: ah sorry it's a prototype, my bad. I just saw "public" in the files and assumed this was something that went through quickly before the Swift 3 line dropped. |
on Mon Jul 18 2016, karwa <notifications-AT-i.8713187.xyz> wrote:
No, prototypes don't require evolution proposals.
Actually it is very Swift. That's exactly how
While that exposes nice simple type names, it's much less optimizable. Dave |
Nate, why isn’t it better to |
I think the only benefit is that we don't have a random-access flattened collection, since the number of sub-collections is unknown. For the rest it seemed easier to implement all the RotatedCollections the same way.
I used a separate file because this seemed like an alternative implementation of some of the ideas in Algorithms.swift. Would you prefer it all together? I can use a prefix or something so the |
on Tue Jul 19 2016, Nate Cook <notifications-AT-i.8713187.xyz> wrote:
You can do it if the size of the sub-collections is uniform, or,
Makes some sense.
I thought we agreed that you were improving on some of the things Dave |
d68d26f
to
ebb130c
Compare
@swift-ci Please test |
Thanks for your work on this, Nate! |
What's in this pull request?
This request adds two new wrapping collections as standard library prototypes:
Resolved bug number: n/a
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.
This one is based on ConcatenatedCollection, which concatenates
two collections with the same element type.