Safe Haskell | Safe-Inferred |
---|
Replacements for unhelpful Haskell list functions. If the standard versions are passed an empty list then we don't get a proper source location.
- takeHead :: [a] -> Maybe a
- takeTail :: [a] -> Maybe [a]
- takeInit :: [a] -> Maybe [a]
- takeMaximum :: Ord a => [a] -> Maybe a
- index :: [a] -> Int -> Maybe a
- findDuplicates :: Ord n => [n] -> [n]
Documentation
takeMaximum :: Ord a => [a] -> Maybe aSource
Take the maximum of a list, or Nothing
if it's empty.
index :: [a] -> Int -> Maybe aSource
Retrieve the element at the given index, or `Nothing if it's not there.
findDuplicates :: Ord n => [n] -> [n]Source
Fine the duplicate values in a list.