Safe Haskell | Safe-Inferred |
---|
- module Data.Maybe
- data MaybeErr err val
- failME :: err -> MaybeErr err val
- isSuccess :: MaybeErr err val -> Bool
- fmapM_maybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)
- orElse :: Maybe a -> a -> a
- mapCatMaybes :: (a -> Maybe b) -> [a] -> [b]
- allMaybes :: [Maybe a] -> Maybe [a]
- firstJust :: Maybe a -> Maybe a -> Maybe a
- firstJusts :: [Maybe a] -> Maybe a
- expectJust :: String -> Maybe a -> a
- maybeToBool :: Maybe a -> Bool
- newtype MaybeT m a = MaybeT {}
Documentation
module Data.Maybe
fmapM_maybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)Source
mapCatMaybes :: (a -> Maybe b) -> [a] -> [b]Source
allMaybes :: [Maybe a] -> Maybe [a]Source
Collects a list of Justs
into a single Just
, returning Nothing
if
there are any Nothings
.
firstJusts :: [Maybe a] -> Maybe aSource
Takes a list of Maybes
and returns the first Just
if there is one, or
Nothing
otherwise.
expectJust :: String -> Maybe a -> aSource
maybeToBool :: Maybe a -> BoolSource