Idris2Doc : Control.Monad.Maybe

Control.Monad.Maybe

Definitions

data MaybeT : (Type -> Type) -> Type -> Type
  A monad transformer extending an inner monad with the ability to not return
a result.

Sequenced actions produce a result only if both actions return a result.

`MaybeT m a` is equivalent to `EitherT () m a`, that is, an computation
that can only throw a single, information-less exception.

Totality: total
Visibility: public export
Constructor: 
MkMaybeT : m (Maybe a) -> MaybeT m a

Hints:
Monad m => Alternative (MaybeT m)
Applicative m => Applicative (MaybeT m)
Eq (m (Maybe a)) => Eq (MaybeT m a)
Foldable m => Foldable (MaybeT m)
Functor m => Functor (MaybeT m)
HasIO m => HasIO (MaybeT m)
Monad m => Monad (MaybeT m)
Monad m => MonadError () (MaybeT m)
MonadError e m => MonadError e (MaybeT m)
MonadTrans MaybeT
Monad m => Monoid (MaybeT m a)
Ord (m (Maybe a)) => Ord (MaybeT m a)
Monad m => Semigroup (MaybeT m a)
Show (m (Maybe a)) => Show (MaybeT m a)
Traversable m => Traversable (MaybeT m)
runMaybeT : MaybeT m a -> m (Maybe a)
  Unwrap a `MaybeT` computation.

Totality: total
Visibility: public export
isNothingT : Functor m => MaybeT m a -> m Bool
  Check if a monadic computation returns a result. This returns `False` if
the computation returns a result, and `True` otherwise.

This is a version of `isNothing` lifted to work with `MaybeT`.

Totality: total
Visibility: public export
isJustT : Functor m => MaybeT m a -> m Bool
  Check if a monadic computation returns a result. This returns `True` if
the computation returns a result, and `False` otherwise.

This is a version of `isJust` lifted to work with `MaybeT`.

Totality: total
Visibility: public export
maybeT : Monad m => m b -> (a -> m b) -> MaybeT m a -> m b
  Run a `MaybeT` computation, handling the case of a result or no result
separately.

This is a version of `maybe` lifted to work with `MaybeT`.

Totality: total
Visibility: public export
fromMaybeT : Monad m => m a -> MaybeT m a -> m a
  Run a `MaybeT` computation providing a default value.

This is a version of `fromMaybe` lifted to work with `MaybeT`.

Totality: total
Visibility: public export
toMaybeT : Functor m => Bool -> m a -> MaybeT m a
  Return a value if a condition is met, or else no value. The condition
only affects whether the `Maybe` produces a value; the effect is run
either way.

This is a version of `toMaybe` lifted to work with `MaybeT`.

Totality: total
Visibility: public export
mapMaybeT : (m (Maybe a) -> n (Maybe a')) -> MaybeT m a -> MaybeT n a'
  Map over the underlying computation.

Totality: total
Visibility: public export
just : Applicative m => a -> MaybeT m a
  A version of `Just` lifted to work with `MaybeT`.

This is equivalent to `pure`.

Totality: total
Visibility: public export
nothing : Applicative m => MaybeT m a
  A version of `Nothing` lifted to work with `MaybeT`.

This is equivalent to `throwE ()`.

Totality: total
Visibility: public export