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