ghc-7.10.1: The GHC API

Safe HaskellSafe
LanguageHaskell2010

Maybes

Synopsis

Documentation

module Data.Maybe

data MaybeErr err val Source

Constructors

Succeeded val 
Failed err 

Instances

failME :: err -> MaybeErr err val Source

orElse :: Maybe a -> a -> a infixr 4 Source

Flipped version of fromMaybe, useful for chaining.

firstJusts :: [Maybe a] -> Maybe a Source

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 a Source

Constructors

MaybeT 

Fields

runMaybeT :: m (Maybe a)
 

Instances

liftMaybeT :: Monad m => m a -> MaybeT m a Source