protolude-0.3.4: A small prelude.

Safe Haskell | Safe
Language | Haskell2010

Protolude.Safe

# Documentation

headMay :: [a] -> Maybe a #

headDef :: a -> [a] -> a #

initMay :: [a] -> Maybe [a] #

initDef :: [a] -> [a] -> [a] #

initSafe :: [a] -> [a] #

tailMay :: [a] -> Maybe [a] #

tailDef :: [a] -> [a] -> [a] #

tailSafe :: [a] -> [a] #

lastDef :: a -> [a] -> a #

lastMay :: [a] -> Maybe a #

foldr1May :: (a -> a -> a) -> [a] -> Maybe a #

foldl1May :: (a -> a -> a) -> [a] -> Maybe a #

foldl1May' :: (a -> a -> a) -> [a] -> Maybe a #

maximumMay :: Ord a => [a] -> Maybe a #

minimumMay :: Ord a => [a] -> Maybe a #

maximumDef :: Ord a => a -> [a] -> a #

minimumDef :: Ord a => a -> [a] -> a #

atMay :: [a] -> Int -> Maybe a #

atDef :: a -> [a] -> Int -> a #