Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- nodups :: Eq a => [a] -> Bool
- dups :: Eq a => [a] -> [a]
- dupsBy :: (a -> a -> Bool) -> [a] -> [a]
- soleElement :: Monad m => [a] -> m a
- equivalentBy :: (a -> a -> Bool) -> [a] -> Bool
- equivalent :: Eq a => [a] -> Bool
- whenJust :: Monad m => (a -> m ()) -> Maybe a -> m ()
- maybeM :: Monad m => String -> Maybe a -> m a
Utilities
dups :: Eq a => [a] -> [a] Source
Discard the last occurrence of each element in the list. Thus the returned list contains only the duplicated elements.
dupsBy :: (a -> a -> Bool) -> [a] -> [a] Source
Generalisation of dups
to an arbitrary equality predicate.
soleElement :: Monad m => [a] -> m a Source
equivalentBy :: (a -> a -> Bool) -> [a] -> Bool Source
A generalisation of equivalent
to any equivalence relation.
equivalent = equivalentBy (==)
equivalent :: Eq a => [a] -> Bool Source
Determine if all elements of a list are equal.