[swift-evolution] Add stableSort() to the standard library.

Charles Kissinger crk at akkyra.com
Sun Jan 10 21:28:52 CST 2016


> On Jan 10, 2016, at 3:11 PM, Davide Italiano via swift-evolution <swift-evolution at swift.org> wrote:

> Add stableSort() to the standard library.
I am in favor of this. I have a use for it.

> An alternative would be that of augmenting sort() to get a Bool as argument
> (stable: True).
This approach, probably with a default of stable: Bool = false, might be more in line with the latest API guidelines. I kind of prefer separate functions myself.

> Should we also provide a stableSortInPlace() implementation?

Definitely! It doesn’t make sense to have a mutating version of the unstable sort but not a corresponding mutating stable sort.

-CK


More information about the swift-evolution mailing list