A few months ago, I started implementing these
After finishing implementing them, I added others inspired from Rust's iterator adaptors and https://bugs.swift.org/browse/SR-6864.
Here's the package if you're interested:
It includes support for
- lazy splitting sequences and collections
- chunking sequences and collections
- windowing sequences and collections
- chaining sequences together
- cycling sequences
- inspecting sequences (easier debugging)
- map while (like
prefix(while:) but supports
- peeking on an iterator
- repeating an element forever
- scanning (similar to
reduce but keeping all previous instances)
- stepping by a fixed number of steps
I plan on adding more string modifiers sense for strings like
What would the next steps be to add these modifiers to the standard library assuming that is still desired?
The typical flow is as follows:
- Proposal and implementation.
- Review by community and core team. Possibly sent for revision back to step 2.
- Addition to the standard library preview package.
- Gather feedback and make changes based on usage experience.
- Addition to standard library.
All of this is from memory, I didn't read the docs, so I might've missed something.
I guess this could count as Pitch phase. The whole process is documented here: