[Deferred] SE-0078: Implement a rotate algorithm, equivalent to std::rotate() in C++


(Chris Lattner) #1

Proposal link: https://github.com/apple/swift-evolution/blob/master/proposals/0078-rotate-algorithm.md

Hello Swift Community,

The review of SE-0078: "Implement a rotate algorithm, equivalent to std::rotate() in C++" ran from May 3…9, 2016. The proposal is *Deferred* from Swift 3.

The general “rotate a collection by N elements” operation is a powerful operation that is nice to have in certain domains, but also has very narrow applicability. Further, the proposal has high implementation complexity (particularly when dealing with lazy collections) due to missing generics features like constrained extensions. As such, the core team has decided to defer this feature until the dependent generics features are available.

One specific exception to this deferral is the reverse() algorithm proposed for BidirectionalCollection. This algorithm is simple and straight-forward, so it is approved for Swift 3.

Thank you to Nate Cook & Sergey Bolshedvorsky for driving this discussion. We should discuss this again when constrained extensions are available in the compiler, and the proposal can be simplified to reflect that. Thank you to Dmitri Gribenko for implementing the reverse() algorithm.

-Chris Lattner
Review Manager