Movatterモバイル変換


[0]ホーム

URL:


base-4.12.0.0: Basic libraries

Safe HaskellNone
LanguageHaskell2010

GHC.Maybe

Description

Maybe type

Synopsis

Documentation

dataMaybe aSource#

TheMaybe type encapsulates an optional value. A value of typeMaybe a either contains a value of typea (represented asJust a), or it is empty (represented asNothing). 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.

Constructors

Nothing 
Just a 
Instances
MonadMaybeSource#

Since: 2.1

Instance details

Defined inGHC.Base

Methods

(>>=) ::Maybe a -> (a ->Maybe b) ->Maybe bSource#

(>>) ::Maybe a ->Maybe b ->Maybe bSource#

return :: a ->Maybe aSource#

fail ::String ->Maybe aSource#

FunctorMaybeSource#

Since: 2.1

Instance details

Defined inGHC.Base

Methods

fmap :: (a -> b) ->Maybe a ->Maybe bSource#

(<$) :: a ->Maybe b ->Maybe aSource#

MonadFixMaybeSource#

Since: 2.1

Instance details

Defined inControl.Monad.Fix

Methods

mfix :: (a ->Maybe a) ->Maybe aSource#

MonadFailMaybeSource#

Since: 4.9.0.0

Instance details

Defined inControl.Monad.Fail

Methods

fail ::String ->Maybe aSource#

ApplicativeMaybeSource#

Since: 2.1

Instance details

Defined inGHC.Base

Methods

pure :: a ->Maybe aSource#

(<*>) ::Maybe (a -> b) ->Maybe a ->Maybe bSource#

liftA2 :: (a -> b -> c) ->Maybe a ->Maybe b ->Maybe cSource#

(*>) ::Maybe a ->Maybe b ->Maybe bSource#

(<*) ::Maybe a ->Maybe b ->Maybe aSource#

FoldableMaybeSource#

Since: 2.1

Instance details

Defined 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#

null ::Maybe a ->BoolSource#

length ::Maybe a ->IntSource#

elem ::Eq a => a ->Maybe a ->BoolSource#

maximum ::Ord a =>Maybe a -> aSource#

minimum ::Ord a =>Maybe a -> aSource#

sum ::Num a =>Maybe a -> aSource#

product ::Num a =>Maybe a -> aSource#

TraversableMaybeSource#

Since: 2.1

Instance details

Defined inData.Traversable

Methods

traverse ::Applicative f => (a -> f b) ->Maybe a -> f (Maybe b)Source#

sequenceA ::Applicative f =>Maybe (f a) -> f (Maybe a)Source#

mapM ::Monad m => (a -> m b) ->Maybe a -> m (Maybe b)Source#

sequence ::Monad m =>Maybe (m a) -> m (Maybe a)Source#

MonadPlusMaybeSource#

Since: 2.1

Instance details

Defined inGHC.Base

AlternativeMaybeSource#

Since: 2.1

Instance details

Defined inGHC.Base

MonadZipMaybeSource#

Since: 4.8.0.0

Instance details

Defined inControl.Monad.Zip

Methods

mzip ::Maybe a ->Maybe b ->Maybe (a, b)Source#

mzipWith :: (a -> b -> c) ->Maybe a ->Maybe b ->Maybe cSource#

munzip ::Maybe (a, b) -> (Maybe a,Maybe b)Source#

Show1MaybeSource#

Since: 4.9.0.0

Instance details

Defined inData.Functor.Classes

Methods

liftShowsPrec :: (Int -> a ->ShowS) -> ([a] ->ShowS) ->Int ->Maybe a ->ShowSSource#

liftShowList :: (Int -> a ->ShowS) -> ([a] ->ShowS) -> [Maybe a] ->ShowSSource#

Read1MaybeSource#

Since: 4.9.0.0

Instance details

Defined inData.Functor.Classes

Ord1MaybeSource#

Since: 4.9.0.0

Instance details

Defined inData.Functor.Classes

Methods

liftCompare :: (a -> b ->Ordering) ->Maybe a ->Maybe b ->OrderingSource#

Eq1MaybeSource#

Since: 4.9.0.0

Instance details

Defined inData.Functor.Classes

Methods

liftEq :: (a -> b ->Bool) ->Maybe a ->Maybe b ->BoolSource#

Eq a =>Eq (Maybe a)Source#

Since: 2.1

Instance details

Defined inGHC.Maybe

Methods

(==) ::Maybe a ->Maybe a ->Bool#

(/=) ::Maybe a ->Maybe a ->Bool#

Data a =>Data (Maybe a)Source#

Since: 4.0.0.0

Instance details

Defined 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

Instance details

Defined inGHC.Maybe

Methods

compare ::Maybe a ->Maybe a ->Ordering#

(<) ::Maybe a ->Maybe a ->Bool#

(<=) ::Maybe a ->Maybe a ->Bool#

(>) ::Maybe a ->Maybe a ->Bool#

(>=) ::Maybe a ->Maybe a ->Bool#

max ::Maybe a ->Maybe a ->Maybe a#

min ::Maybe a ->Maybe a ->Maybe a#

Read a =>Read (Maybe a)Source#

Since: 2.1

Instance details

Defined inGHC.Read

Show a =>Show (Maybe a)Source#

Since: 2.1

Instance details

Defined inGHC.Show

Generic (Maybe a)Source# 
Instance details

Defined inGHC.Generics

Associated Types

typeRep (Maybe a) ::Type ->TypeSource#

Methods

from ::Maybe a ->Rep (Maybe a) xSource#

to ::Rep (Maybe a) x ->Maybe aSource#

Semigroup a =>Semigroup (Maybe a)Source#

Since: 4.9.0.0

Instance details

Defined inGHC.Base

Semigroup a =>Monoid (Maybe a)Source#

Lift a semigroup intoMaybe forming aMonoid according tohttp://en.wikipedia.org/wiki/Monoid: "Any semigroupS may be turned into a monoid simply by adjoining an elemente not inS and defininge*e = e ande*s = s = s*e for alls ∈ S."

Since 4.11.0: constraint on innera value generalised fromMonoid toSemigroup.

Since: 2.1

Instance details

Defined inGHC.Base

Generic1MaybeSource# 
Instance details

Defined inGHC.Generics

Associated Types

typeRep1Maybe :: k ->TypeSource#

typeRep (Maybe a)Source#

Since: 4.6.0.0

Instance details

Defined inGHC.Generics

typeRep1MaybeSource#

Since: 4.6.0.0

Instance details

Defined inGHC.Generics

Produced byHaddock version 2.20.0


[8]ページ先頭

©2009-2025 Movatter.jp