Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Functions to remove duplicates from a list.
Performance
To check the performance many benchmarks were done.
Benchmarks were made on lists of Int
s and Text
s.
There were two types of list to use:
- Lists which consist of many different elements
- Lists which consist of many same elements
Here are some recomendations for usage of particular functions based on benchmarking resutls.
Documentation
sortNub :: Ord a => [a] -> [a] Source #
Like ordNub
but also sorts a list.
>>>
sortNub [3, 3, 3, 2, 2, -1, 1]
[-1,1,2,3]
unstableNub :: Hashable a => [a] -> [a] Source #
Like hashNub
but has better performance and also doesn't save the order.
>>>
unstableNub [3, 3, 3, 2, 2, -1, 1]
[1,2,3,-1]