Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Basic utilities
Documentation
nub' :: Ord a => [a] -> [a] Source #
Like nub
, but O(n log n) instead of O(n^2), since it uses a set to lookup previous things.
The result list is stable (the elements are returned in the order they occur), and lazy.
Requires that the list elements can be compared by Ord.
Code ruthlessly taken from http://hpaste.org/54411