Copyright | (c) Volodymyr Yaschenko |
---|---|
License | BSD3 |
Maintainer | ualinuxcn@gmail.com |
Stability | Unstable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Library provides functions to find unique and duplicate elements in the list. Unlike Data.List.Unique this one uses Data.Map.Strict for calculations. So it's much faster and it uses less memory.
Documentation
repeated :: Ord a => [a] -> [a] Source
repeated
finds only the elements that are present more than once in the list. Example:
repeated "foo bar" == "o"
repeatedBy :: Ord a => (Int -> Bool) -> [a] -> [a] Source
The repeatedBy
function behaves just like repeated, except it uses a user-supplied equality predicate.
repeatedBy (>2) "This is the test line" == " eist"
unique :: Ord a => [a] -> [a] Source
unique
gets only unique elements, that do not have duplicates.
It sorts them. Example:
unique "foo bar" == " abfr"