| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Polysemy.Conc.Effect.Mask
Description
Synopsis
- data RestoreMask (a :: Type -> Type) b where
- Restore :: forall (a :: Type -> Type) b. a b -> RestoreMask a b
- restore :: forall (r :: EffectRow) a. Member RestoreMask r => Sem r a -> Sem r a
- newtype Restoration = Restoration {
- unRestoration :: forall a. IO a -> IO a
- data MaskMode
- type Mask = Scoped MaskMode RestoreMask
- type UninterruptibleMask = Mask
- mask :: forall (r :: EffectRow). Member Mask r => InterpreterFor RestoreMask r
- uninterruptibleMask :: forall (r :: EffectRow). Member Mask r => InterpreterFor RestoreMask r
Documentation
data RestoreMask (a :: Type -> Type) b where Source #
Part of an effect abstracting mask.
Constructors
| Restore :: forall (a :: Type -> Type) b. a b -> RestoreMask a b |
restore :: forall (r :: EffectRow) a. Member RestoreMask r => Sem r a -> Sem r a Source #
Restore the previous masking state.
Can only be called inside of an action passed to mask or uninterruptibleMask.
newtype Restoration Source #
Constructors
| Restoration | |
Fields
| |
Whether mask or uninterruptibleMask was requested.
Constructors
| Interruptible | |
| Uninterruptible |
type Mask = Scoped MaskMode RestoreMask Source #
The scoped masking effect, parameterized by MaskMode.
type UninterruptibleMask = Mask Source #
Deprecated: Use Mask instead, which now handles both variants via MaskMode
Deprecated synonym for Mask.
mask :: forall (r :: EffectRow). Member Mask r => InterpreterFor RestoreMask r Source #
Mark a region as masked.
Uses the Scoped pattern with Interruptible.
uninterruptibleMask :: forall (r :: EffectRow). Member Mask r => InterpreterFor RestoreMask r Source #
Mark a region as uninterruptibly masked.
Uses the Scoped pattern with Uninterruptible.