Sort `Collection` using `KeyPath`

One other thing I want to throw in here is that with this form of the API, we can use the Schwartzian transform to only calculate the value at the keypath once per element instead of O(nlogn) times. It could be an option on the function. It would result in much faster sorts when the value at the keypath is expensive to retrieve.

6 Likes