Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Mask :: Effect where
- data MaskMode
- threadMaskViaClass :: forall t m a. Monad m => (RepresentationalT t, forall b. MonadMask b => MonadMask (t b)) => (forall x. Mask m x -> m x) -> Mask (t m) a -> t m a
Effects
data Mask :: Effect where Source #
An effect for masking asynchronous exceptions.
Mask
is typically used as a primitive effect.
If you define a Carrier
that relies on a novel
non-trivial monad transformer t
, then you need to make
a
instance (if possible).
ThreadsEff
t Mask
threadMaskViaClass
can help you with that.
The following threading constraints accept Mask
:
Instances
ThreadsEff (ExceptT e) Mask Source # | |
Monoid s => ThreadsEff (WriterT s) Mask Source # | |
ThreadsEff (StateT s) Mask Source # | |
ThreadsEff (ReaderT i) Mask Source # | |
ThreadsEff (StateT s) Mask Source # | |
Monoid s => ThreadsEff (WriterT s) Mask Source # | |
Monoid s => ThreadsEff (WriterT s) Mask Source # | |
Monad m => MonadThrow (ViaAlg s Mask m) Source # | |
Monad m => MonadCatch (ViaAlg s Mask m) Source # | |
(Reifies s (ReifiedEffAlgebra Mask m), Monad m) => MonadMask (ViaAlg s Mask m) Source # | |
Defined in Control.Effect.Type.Mask mask :: ((forall a. ViaAlg s Mask m a -> ViaAlg s Mask m a) -> ViaAlg s Mask m b) -> ViaAlg s Mask m b # uninterruptibleMask :: ((forall a. ViaAlg s Mask m a -> ViaAlg s Mask m a) -> ViaAlg s Mask m b) -> ViaAlg s Mask m b # generalBracket :: ViaAlg s Mask m a -> (a -> ExitCase b -> ViaAlg s Mask m c) -> (a -> ViaAlg s Mask m b) -> ViaAlg s Mask m (b, c) # |
Threading utilities
threadMaskViaClass :: forall t m a. Monad m => (RepresentationalT t, forall b. MonadMask b => MonadMask (t b)) => (forall x. Mask m x -> m x) -> Mask (t m) a -> t m a Source #
A valid definition of threadEff
for a
instance,
given that ThreadsEff
t Mask
t
lifts
.MonadMask
BEWARE: threadMaskViaClass
is only safe if the implementation of
mask
and uninterruptibleMask
for t m
only makes use of mask
and uninterruptibleMask
for m
, and no other methods of
MonadThrow
, MonadCatch
, and MonadMask
.