Safe Haskell | None |
---|---|
Language | Haskell2010 |
A church-encoded carrier for Empty
.
Since: 1.1.0.0
Synopsis
- runEmpty :: m b -> (a -> m b) -> EmptyC m a -> m b
- evalEmpty :: Applicative m => EmptyC m a -> m ()
- execEmpty :: Applicative m => EmptyC m a -> m Bool
- newtype EmptyC (m :: Type -> Type) a = EmptyC (forall b. m b -> (a -> m b) -> m b)
- module Control.Effect.Empty
Empty carrier
evalEmpty :: Applicative m => EmptyC m a -> m () Source #
execEmpty :: Applicative m => EmptyC m a -> m Bool Source #
Run an Empty
effect, replacing its result with a Bool
indicating whether control exited normally.
This is convenient for using empty
to signal early returns when all you need to know is whether control exited normally or not, and not what value it exited with.
execEmpty
=runEmpty
(pure
False
) (const
(pure
True
))
execEmpty
(pure
a) =pure
True
execEmpty
empty
=pure
False
Since: 1.1.0.0
newtype EmptyC (m :: Type -> Type) a Source #
Since: 1.1.0.0
EmptyC (forall b. m b -> (a -> m b) -> m b) |
Instances
MonadTrans EmptyC Source # | |
Defined in Control.Carrier.Empty.Church | |
MonadIO m => MonadIO (EmptyC m) Source # | |
Defined in Control.Carrier.Empty.Church | |
Applicative (EmptyC m) Source # | |
Functor (EmptyC m) Source # | |
Monad (EmptyC m) Source # | |
MonadFail m => MonadFail (EmptyC m) Source # | |
Defined in Control.Carrier.Empty.Church | |
MonadFix m => MonadFix (EmptyC m) Source # | |
Defined in Control.Carrier.Empty.Church | |
Algebra sig m => Algebra (Empty :+: sig) (EmptyC m) Source # | |
Empty effect
module Control.Effect.Empty