Data.List.nub is O(n²). This one is O(n log n) by requiring an Ord instance.