
13 Mar
2007
13 Mar
'07
6:39 p.m.
On Tue, Mar 13, 2007 at 03:16:44AM +0000, Neil Mitchell wrote:
I propose the addition of sortNub and sortNubBy.
I would rather see nubSorted :: Eq a => [a] -> [a] nubSorted (x1:x2:xs) | x1 == x2 = nubSorted (x1:xs) nubSorted (x:xs) = x : nubSorted xs nubSorted [] = [] You can then nubSorted . sort, but you can also use it on data that you know is already sorted (or at least data in which all the dupes you want to eliminate are in clumps). Thanks Ian