Functions to facilitate compound sorting strategies by composing sort comparators