Can you mutate the original collection through an IndexingCollection
, like we can through a SubSequence
?
What happens if the destination index is part of the moved set? For the single-element and contiguous-range versions, I'm guessing a no-op. But what happens for discontinuous move sets?
These methods don't use RangeSet
(externally); are they still related to RangeSet
, or did you add them just for the heck of it? If the latter, maybe they could go into a separate pitch.
(Rotation has been brought up at least twice before.)
For the second and third methods, "partition" is used as a verb, not a noun. So the modifier should be "stably." I'm still trying to figure out how to incorporate the "half" in the second method. Maybe use "partitionWithStablePrefix"?
Those are the same thing. If the moved elements go on top of the specified destination index, the target element would move forward; that's equivalent to them going before the target element.
Sometimes while implementing a type, you have to include all of the base protocols; protocol base implication does not work. Maybe that happened to the author.

The pitch introduces stablePartition (mutating) and stablyPartitioned (non-mutating); perhaps it would be a good idea to unify these (stable/stably) terms somehow.
Otherwise, this an excellent proposal and I cannot wait to use these APIs.
"stably" is the adverb form of "stable," so the method pair's names are already unified. The term change in the modifier is to match the one in the main word ("partitioned"/"partition").