I have other ideas yet.
The selector undefinedFirst is good, but the implementation not so.
I don't like the UndefinedSortFunction: too specific, compose oddly...
In the PR, collatedBy: is the way to tell how we sort properties (if you have a better name, go, it's bikesheding day)
������ "sort by size of name"
������ (people sorted: (#name collatedBy: #size))
�������������� =�� (people sorted: [:p| p name size])
If we defined <=> in Boolean (orWhatEverTheLongSelectorYouPreferBecausePharoHasTheFreedomToHaveOwnTaste:)
in order to have true sorted first, then we can generalize.
������ "sort by absolute value, but put the negative first"
������ numbers sorted: #negative sortedFirst, #abs
������ "sort by name, but put the undefined last"
������ people sorted: (#name collatedBy: #isNil sortedLast) , #name.
sortedFirst in this case would be a synonym for ascending (or asSortFunction).
Alternatively, if we don't want <=> in Boolean because it's not natural (the fact that we need a synonym is a clue)
then we can have sortedFirst answering a specialized BooleanSortFunction.