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-6867] "Chunking" split #49416

airspeedswift opened this issue Jan 29, 2018 · 1 comment

[SR-6867] "Chunking" split #49416

airspeedswift opened this issue Jan 29, 2018 · 1 comment


Copy link

airspeedswift commented Jan 29, 2018

Previous ID SR-6867
Radar None
Original Reporter @airspeedswift
Type New Feature
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels New Feature, StarterProposal
Assignee None
Priority Medium

md5: d78e8d70fcb68ef04d5d9fac882fce1f

Issue Description:

It is possible to split a collection per element, but not by a count i.e. split an array into subsequences of length 3, or more generally any collection into subsequence of length n. There should be a ability to do this lazily for collections and eagerly for sequences.

Copy link

jckarter commented Feb 14, 2018

Along these lines, the "every adjacent n elements" split is frequently useful too, e.g. for [a, b, c, d, e], give [[a, b, c], [b, c, d], [c, d, e]] .

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants