nub package:slist

O(n^2). Removes duplicate elements from a slist. In particular, it keeps only the first occurrence of each element. It is a special case of nubBy, which allows to supply your own equality test.
>>> nub $ replicate 5 'a'
Slist {sList = "a", sSize = Size 1}

>>> nub mempty
Slist {sList = [], sSize = Size 0}

>>> nub $ slist [1,2,3,4,3,2,1,2,4,3,5]
Slist {sList = [1,2,3,4,5], sSize = Size 5}
O(n^2). Behaves just like nub, except it uses a user-supplied equality predicate instead of the overloaded == function.
>>> nubBy (\x y -> mod x 3 == mod y 3) $ slist [1,2,4,5,6]
Slist {sList = [1,2,6], sSize = Size 3}
Removes duplicate elements from a slist, keeping only the first occurance of the element. Like nub but runs in <math> time and requires Ord.
>>> ordNub $ slist [3, 3, 3, 2, 2, -1, 1]
Slist {sList = [3,2,-1,1], sSize = Size 4}