Skip to content
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

[SR-3419] Strides should be collections #46007

Open
airspeedswift opened this issue Dec 14, 2016 · 0 comments
Open

[SR-3419] Strides should be collections #46007

airspeedswift opened this issue Dec 14, 2016 · 0 comments
Labels
affects ABI Flag: Affects ABI good first issue Good for newcomers improvement standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal

Comments

@airspeedswift
Copy link
Member

Previous ID SR-3419
Radar rdar://problem/17816925
Original Reporter @airspeedswift
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement, AffectsABI, StarterProposal, swift-evolution-proposal-needed
Assignee None
Priority Medium

md5: 20684cd6a789b38a9426158bdf2d0b60

Issue Description:

In Swift 3.0, StrideTo and StrideThrough conform to Sequence, but not Collection.

While they can't be bi-directional or random-access, as the last (or abitrary) element can't necessarily be reached in O( n ) for all strideable types, it should be possible to make them forward-only collections. One straightforward implementation would be to make the index each value zipped with a count (for Comparable purposes).

Once we have conditional conformance, it should be possible to make specific strides (e.g. ones over integers) conform to random access.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added good first issue Good for newcomers and removed StarterProposal labels Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects ABI Flag: Affects ABI good first issue Good for newcomers improvement standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal
Projects
None yet
Development

No branches or pull requests

2 participants