ghc-7.8.20140130: The GHC API

Safe HaskellSafe-Inferred
LanguageHaskell98

Maybes

Synopsis

Documentation

module Data.Maybe

data MaybeErr err valSource

Constructors

Succeeded val 
Failed err 

Instances

failME :: err -> MaybeErr err valSource

orElse :: Maybe a -> a -> aSource

flipped version of fromMaybe.

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.

whenIsJust :: Monad m => Maybe a -> (a -> m ()) -> m ()Source

newtype MaybeT m aSource

Constructors

MaybeT 

Fields

runMaybeT :: m (Maybe a)
 

Instances

Monad m => Monad (MaybeT m) 
Functor m => Functor (MaybeT m) 
(Monad m, Functor m) => Applicative (MaybeT m)