saxbophone / tr-sort

Transpose-Sort —why sort numbers with comparisons when we can calculate their rough sort positions instead?
https://saxbophone.com/tr-sort
2 stars 0 forks source link

Add support for sorting non-scalar data types #4

Open saxbophone opened 3 years ago

saxbophone commented 3 years ago

The intention is to support this by allowing users to specify their own conversion function for converting data types that are non-scalar into a scalar type of their choosing, to facilitate sorting these types. This is needed because tr-sort sorts by calculating item positions based on their value, not by comparing items with eachother.

It's quite likely that conversion functions for some data types may need access to the whole set being sorted, or some other universal set of possible values depending on each application, so consideration should be made for supporting this too in the design.