List.sortBy allows to use a function on the elements and use its result for the comparison.
> List.sortBy String.length ["longest","short","medium"]
["short","medium","longest"] : List String
-- because the lengths are: [7,5,6]
It ...