The
nubSort function is equivalent to
nub .
sort, except that duplicates are removed as it sorts. It
is essentially the same implementation as
Data.List.sort,
with
merge replaced by
union. Thus the performance of
nubSort should better than or nearly equal to
sort
alone. It is faster than both
sort and
nub .
sort when the input contains significant quantities of
duplicated elements.