Safe Haskell | None |
---|---|
Language | Haskell2010 |
Fail effect
Fail carrier
Instances
MonadTrans FailC Source # | |
Defined in Control.Effect.Fail | |
Monad m => Monad (FailC m) Source # | |
Functor m => Functor (FailC m) Source # | |
MonadFix m => MonadFix (FailC m) Source # | |
Defined in Control.Effect.Fail | |
(Carrier sig m, Effect sig) => MonadFail (FailC m) Source # | |
Defined in Control.Effect.Fail | |
Applicative m => Applicative (FailC m) Source # | |
MonadIO m => MonadIO (FailC m) Source # | |
Defined in Control.Effect.Fail | |
Alternative m => Alternative (FailC m) Source # | |
(Alternative m, Monad m) => MonadPlus (FailC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Fail :+: sig) (FailC m) Source # | |
Re-exports
class (HFunctor sig, Monad m) => Carrier sig m | m -> sig Source #
The class of carriers (results) for algebras (effect handlers) over signatures (effects), whose actions are given by the eff
method.
Instances
class Monad m => MonadFail (m :: Type -> Type) where #
When a value is bound in do
-notation, the pattern on the left
hand side of <-
might not match. In this case, this class
provides a function to recover.
A Monad
without a MonadFail
instance may only be used in conjunction
with pattern that always match, such as newtypes, tuples, data types with
only a single data constructor, and irrefutable patterns (~pat
).
Instances of MonadFail
should satisfy the following law: fail s
should
be a left zero for >>=
,
fail s >>= f = fail s
If your Monad
is also MonadPlus
, a popular definition is
fail _ = mzero
Since: base-4.9.0.0