MaybeT

The parameterizable maybe monad, a strict monad obtained by composing an arbitrary monad with the Maybe monad. Computations are actions that may produce a value or exit. The return function yields a computation that produces that value, while >>= sequences two subcomputations, exiting if either computation does.
The parameterizable maybe monad, obtained by composing an arbitrary monad with the Maybe monad. Computations are actions that may produce a value or exit. The return function yields a computation that produces that value, while >>= sequences two subcomputations, exiting if either computation does.
The parameterizable maybe monad, obtained by composing an arbitrary monad with the Maybe monad. Computations are actions that may produce a value or exit. The return function yields a computation that produces that value, while >>= sequences two subcomputations, exiting if either computation does.
Not on Stackage, so not searched. MaybeT monad transformer
Case analysis for MaybeT Use the first argument if the MaybeT computation fails, otherwise apply the function to the successful result.
Embed in the Maybe monad.
Not on Stackage, so not searched. MaybeT monad transformer using transformers instead of mtl.
Not on Stackage, so not searched. MaybeT monad transformer compatible with monads-tf (deprecated)
The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.

Examples

Basic usage:
>>> maybeToList (Just 7)
[7]
>>> maybeToList Nothing
[]
One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:
>>> import GHC.Internal.Text.Read ( readMaybe )

>>> sum $ maybeToList (readMaybe "3")
3

>>> sum $ maybeToList (readMaybe "")
0
Convert a MaybeT computation to ExceptT, with a default exception value.
As timeoutImprovingIO, but don't bother applying a timeout to the action if Nothing is given as the number of microseconds to apply the time out for.
Converts a Maybe value to a Flag value.