Modulefused-effects-1.1.2.7Haskell2010
Control.Carrier.Empty.Maybe
A carrier for an Empty effect, indicating failure with a Nothing value. Users that need access to an error message should use the Fail effect.
Note that Empty effects can, when they are the last effect in a stack, be interpreted directly to a Maybe without a call to runEmpty.
- 1 type
- 3 values
- Packagefused-effects-1.1.2.7
- Exports4
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceMaybe.hs
Empty carrier
4 declarationsRun 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 = fmap isJust . runEmpty
execEmpty (pure a) = pure True
execEmpty empty = pure False
Instances8MonadTrans, Monad, Functor, MonadFix, MonadFail, Applicative, …
MonadTrans EmptyCDefined in fused-effects-1.1.2.7 · Control.Carrier.Empty.MaybeMonad m => Monad (EmptyC m)Defined in fused-effects-1.1.2.7 · Control.Carrier.Empty.MaybeFunctor m => Functor (EmptyC m)Defined in fused-effects-1.1.2.7 · Control.Carrier.Empty.MaybeMonadFix m => MonadFix (EmptyC m)Defined in fused-effects-1.1.2.7 · Control.Carrier.Empty.MaybeMonadFail m => MonadFail (EmptyC m)Defined in fused-effects-1.1.2.7 · Control.Carrier.Empty.MaybeMonad m => Applicative (EmptyC m)Defined in fused-effects-1.1.2.7 · Control.Carrier.Empty.MaybeMonadIO m => MonadIO (EmptyC m)Defined in fused-effects-1.1.2.7 · Control.Carrier.Empty.MaybeAlgebra sig m => Algebra (Empty :+: sig) (EmptyC m)Defined in fused-effects-1.1.2.7 · Control.Carrier.Empty.Maybe
Empty effect
0 declarationsmodule Control.Effect.Empty