Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- singleListToJust :: [a] -> Maybe a
- whenA :: (Monad m, Alternative z) => Bool -> m a -> m (z a)
- countLength :: Eq a => [a] -> [(a, Int)]
Documentation
singleListToJust :: [a] -> Maybe a Source #
Returns the head of the list iff there is exactly one element.
whenA :: (Monad m, Alternative z) => Bool -> m a -> m (z a) Source #
Like when
, but in the context of an Alternative
.
countLength :: Eq a => [a] -> [(a, Int)] Source #
Count the number of times a
is present in the list.