ghc-6.12.2: The GHC APISource codeContentsIndex
Maybes
Synopsis
module Data.Maybe
data MaybeErr err val
= Succeeded val
| Failed err
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
expectJust :: String -> Maybe a -> a
maybeToBool :: Maybe a -> Bool
newtype MaybeT m a = MaybeT {
runMaybeT :: m (Maybe a)
}
Documentation
module Data.Maybe
data MaybeErr err val Source
Constructors
Succeeded val
Failed err
show/hide Instances
failME :: err -> MaybeErr err valSource
isSuccess :: MaybeErr err val -> BoolSource
fmapM_maybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)Source
orElse :: Maybe a -> a -> aSource
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.
firstJust :: [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
newtype MaybeT m a Source
Constructors
MaybeT
runMaybeT :: m (Maybe a)
show/hide Instances
Produced by Haddock version 2.6.1