glguy / tries

BSD 3-Clause "New" or "Revised" License
11 stars 8 forks source link

Consider list nubbing functions #7

Open treeowl opened 6 years ago

treeowl commented 6 years ago

containers is adding Data.Containers.ListUtils in the next version with

nubOrd :: Ord a => [a] -> [a]
nubOrdOn :: Ord b => (a -> b) -> [a] -> [a]

nubInt :: [Int] -> [Int]
nubIntOn :: (a -> Int) -> [a] -> [a]

I think it might make sense for this package to offer similar functions:

nubTrieKey :: TrieKey a => [a] -> [a]
nubTrieKeyOn :: TrieKey b => (a -> b) -> [a] -> [a]

These would greatly generalize nubInt and nubIntOn.