The nub function which removes duplicate elements from a vector.
Modulevector-algorithms-0.9.1.0Haskell2010
Data.Vector.Algorithms
- 3 values
- Packagevector-algorithms-0.9.1.0
- Exports3
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceAlgorithms.hs
A version of nub with a custom comparison predicate.
Note: This function makes use of sortByUniq using the intro
sort algorithm.
The nubByMut function takes in an in-place sort algorithm and uses it to do a de-deduplicated sort. It then uses this to remove duplicate elements from the input.
Note: Since this algorithm needs the original input and so copies before sorting in-place. As such, it is safe to use on immutable inputs.