| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
GHC.Maybe
Description
Maybe type
TheMaybe type encapsulates an optional value. A value of type either contains a value of typeMaybe aa (represented as), or it is empty (represented asJust aNothing). UsingMaybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such aserror.
TheMaybe type is also a monad. It is a simple kind of error monad, where all errors are represented byNothing. A richer error monad can be built using theEither type.
| MonadMaybeSource# | Since: 2.1 |
| FunctorMaybeSource# | Since: 2.1 |
| MonadFixMaybeSource# | Since: 2.1 |
| MonadFailMaybeSource# | Since: 4.9.0.0 |
| ApplicativeMaybeSource# | Since: 2.1 |
| FoldableMaybeSource# | Since: 2.1 |
Instance detailsDefined inData.Foldable Methods fold ::Monoid m =>Maybe m -> mSource# foldMap ::Monoid m => (a -> m) ->Maybe a -> mSource# foldr :: (a -> b -> b) -> b ->Maybe a -> bSource# foldr' :: (a -> b -> b) -> b ->Maybe a -> bSource# foldl :: (b -> a -> b) -> b ->Maybe a -> bSource# foldl' :: (b -> a -> b) -> b ->Maybe a -> bSource# foldr1 :: (a -> a -> a) ->Maybe a -> aSource# foldl1 :: (a -> a -> a) ->Maybe a -> aSource# toList ::Maybe a -> [a]Source# elem ::Eq a => a ->Maybe a ->BoolSource# maximum ::Ord a =>Maybe a -> aSource# minimum ::Ord a =>Maybe a -> aSource# | |
| TraversableMaybeSource# | Since: 2.1 |
| MonadPlusMaybeSource# | Since: 2.1 |
| AlternativeMaybeSource# | Since: 2.1 |
| MonadZipMaybeSource# | Since: 4.8.0.0 |
| Show1MaybeSource# | Since: 4.9.0.0 |
| Read1MaybeSource# | Since: 4.9.0.0 |
Instance detailsDefined inData.Functor.Classes | |
| Ord1MaybeSource# | Since: 4.9.0.0 |
Instance detailsDefined inData.Functor.Classes | |
| Eq1MaybeSource# | Since: 4.9.0.0 |
| Eq a =>Eq (Maybe a)Source# | Since: 2.1 |
| Data a =>Data (Maybe a)Source# | Since: 4.0.0.0 |
Instance detailsDefined inData.Data Methods gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->Maybe a -> c (Maybe a)Source# gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> c (Maybe a)Source# toConstr ::Maybe a ->ConstrSource# dataTypeOf ::Maybe a ->DataTypeSource# dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (c (Maybe a))Source# dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (c (Maybe a))Source# gmapT :: (forall b.Data b => b -> b) ->Maybe a ->Maybe aSource# gmapQl :: (r -> r' -> r) -> r -> (forall d.Data d => d -> r') ->Maybe a -> rSource# gmapQr :: (r' -> r -> r) -> r -> (forall d.Data d => d -> r') ->Maybe a -> rSource# gmapQ :: (forall d.Data d => d -> u) ->Maybe a -> [u]Source# gmapQi ::Int -> (forall d.Data d => d -> u) ->Maybe a -> uSource# gmapM ::Monad m => (forall d.Data d => d -> m d) ->Maybe a -> m (Maybe a)Source# gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->Maybe a -> m (Maybe a)Source# gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->Maybe a -> m (Maybe a)Source# | |
| Ord a =>Ord (Maybe a)Source# | Since: 2.1 |
| Read a =>Read (Maybe a)Source# | Since: 2.1 |
| Show a =>Show (Maybe a)Source# | Since: 2.1 |
| Generic (Maybe a)Source# | |
| Semigroup a =>Semigroup (Maybe a)Source# | Since: 4.9.0.0 |
| Semigroup a =>Monoid (Maybe a)Source# | Lift a semigroup into Since 4.11.0: constraint on inner Since: 2.1 |
| Generic1MaybeSource# | |
| typeRep (Maybe a)Source# | Since: 4.6.0.0 |
| typeRep1MaybeSource# | Since: 4.6.0.0 |
Produced byHaddock version 2.20.0