Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Mask m a 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
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
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
.