ghc-7.2.1: The GHC API

Maybes

Synopsis

Documentation

module Data.Maybe

data MaybeErr err val Source

Constructors

Succeeded val 
Failed err 

Instances

Monad (MaybeErr err) 

failME :: err -> MaybeErr err valSource

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.

firstJusts :: [Maybe a] -> Maybe aSource

Takes a list of Maybes and returns the first Just if there is one, or Nothing otherwise.

newtype MaybeT m a Source

Constructors

MaybeT 

Fields

runMaybeT :: m (Maybe a)
 

Instances

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