in-other-words-0.1.0.0: A higher-order effect system where the sky's the limit

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Mask

Contents

Synopsis

Effects

data Mask m a 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 ThreadsEff t Mask instance (if possible). threadMaskViaClass can help you with that.

The following threading constraints accept Mask:

Constructors

Mask :: MaskMode -> ((forall x. m x -> m x) -> m a) -> Mask m a 
Instances
ThreadsEff (ExceptT e) (Mask :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (ExceptT e m) a -> ExceptT e m a Source #

Monoid s => ThreadsEff (WriterT s) (Mask :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (WriterT s m) a -> WriterT s m a Source #

ThreadsEff (StateT s) (Mask :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (StateT s m) a -> StateT s m a Source #

ThreadsEff (ReaderT i) (Mask :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (ReaderT i m) a -> ReaderT i m a Source #

ThreadsEff (StateT s) (Mask :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (StateT s m) a -> StateT s m a Source #

Monoid s => ThreadsEff (WriterT s) (Mask :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (WriterT s m) a -> WriterT s m a Source #

Monoid s => ThreadsEff (WriterT s) (Mask :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (WriterT s m) a -> WriterT s m a Source #

Monad m => MonadThrow (ViaAlg s (Mask :: (Type -> Type) -> Type -> Type) m) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

throwM :: Exception e => e -> ViaAlg s Mask m a #

Monad m => MonadCatch (ViaAlg s (Mask :: (Type -> Type) -> Type -> Type) m) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

catch :: Exception e => ViaAlg s Mask m a -> (e -> ViaAlg s Mask m a) -> ViaAlg s Mask m a #

(Reifies s (ReifiedEffAlgebra (Mask :: (Type -> Type) -> Type -> Type) m), Monad m) => MonadMask (ViaAlg s (Mask :: (Type -> Type) -> Type -> Type) m) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

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) #

Actions

mask :: Eff Mask m => ((forall x. m x -> m x) -> m a) -> m a Source #

mask_ :: Eff Mask m => m a -> m a Source #

uninterruptibleMask :: Eff Mask m => ((forall x. m x -> m x) -> m a) -> m a Source #

uninterruptibleMask_ :: Eff Mask m => m a -> m a Source #

Interpretations

maskToIO :: (Carrier m, MonadMask m) => MaskToIOC m a -> m a Source #

Run a Mask effect by making use of the IO-based mask and uninterruptibleMask.

Derivs (MaskToIOC m) = Mask ': Derivs m
Prims  (MaskToIOC m) = Mask ': Prims m

ignoreMask :: Carrier m => IgnoreMaskC m a -> m a Source #

Run a Mask effect by ignoring it, providing no protection against asynchronous exceptions.

Derivs (IgnoreMaskC m) = Mask ': Derivs m
Prims  (IgnoreMaskC m) = Prims m

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 ThreadsEff t Mask instance, given that 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.

MonadMask

class MonadCatch m => MonadMask (m :: Type -> Type) #

A class for monads which provide for the ability to account for all possible exit points from a computation, and to mask asynchronous exceptions. Continuation-based monads are invalid instances of this class.

Instances should ensure that, in the following code:

fg = f `finally` g

The action g is called regardless of what occurs within f, including async exceptions. Some monads allow f to abort the computation via other effects than throwing an exception. For simplicity, we will consider aborting and throwing an exception to be two forms of "throwing an error".

If f and g both throw an error, the error thrown by fg depends on which errors we're talking about. In a monad transformer stack, the deeper layers override the effects of the inner layers; for example, ExceptT e1 (Except e2) a represents a value of type Either e2 (Either e1 a), so throwing both an e1 and an e2 will result in Left e2. If f and g both throw an error from the same layer, instances should ensure that the error from g wins.

Effects other than throwing an error are also overriden by the deeper layers. For example, StateT s Maybe a represents a value of type s -> Maybe (a, s), so if an error thrown from f causes this function to return Nothing, any changes to the state which f also performed will be erased. As a result, g will see the state as it was before f. Once g completes, f's error will be rethrown, so g' state changes will be erased as well. This is the normal interaction between effects in a monad transformer stack.

By contrast, lifted-base's version of finally always discards all of g's non-IO effects, and g never sees any of f's non-IO effects, regardless of the layer ordering and regardless of whether f throws an error. This is not the result of interacting effects, but a consequence of MonadBaseControl's approach.

Minimal complete definition

mask, uninterruptibleMask, generalBracket

Instances
MonadMask IO 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

generalBracket :: IO a -> (a -> ExitCase b -> IO c) -> (a -> IO b) -> IO (b, c) #

e ~ SomeException => MonadMask (Either e)

Since: exceptions-0.8.3

Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b #

uninterruptibleMask :: ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b #

generalBracket :: Either e a -> (a -> ExitCase b -> Either e c) -> (a -> Either e b) -> Either e (b, c) #

MonadMask m => MonadMask (MaybeT m)

Since: exceptions-0.10.0

Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. MaybeT m a -> MaybeT m a) -> MaybeT m b) -> MaybeT m b #

uninterruptibleMask :: ((forall a. MaybeT m a -> MaybeT m a) -> MaybeT m b) -> MaybeT m b #

generalBracket :: MaybeT m a -> (a -> ExitCase b -> MaybeT m c) -> (a -> MaybeT m b) -> MaybeT m (b, c) #

MonadMask m => MonadMask (InterpretFailSimpleC m) Source # 
Instance details

Defined in Control.Effect.Fail

MonadMask m => MonadMask (InterpretAltSimpleC m) Source # 
Instance details

Defined in Control.Effect.Alt

MonadMask m => MonadMask (ExceptT e m)

Since: exceptions-0.9.0

Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. ExceptT e m a -> ExceptT e m a) -> ExceptT e m b) -> ExceptT e m b #

uninterruptibleMask :: ((forall a. ExceptT e m a -> ExceptT e m a) -> ExceptT e m b) -> ExceptT e m b #

generalBracket :: ExceptT e m a -> (a -> ExitCase b -> ExceptT e m c) -> (a -> ExceptT e m b) -> ExceptT e m (b, c) #

(MonadMask m, Monoid w) => MonadMask (WriterT w m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

uninterruptibleMask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

generalBracket :: WriterT w m a -> (a -> ExitCase b -> WriterT w m c) -> (a -> WriterT w m b) -> WriterT w m (b, c) #

MonadMask m => MonadMask (StateT s m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

uninterruptibleMask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

generalBracket :: StateT s m a -> (a -> ExitCase b -> StateT s m c) -> (a -> StateT s m b) -> StateT s m (b, c) #

MonadMask m => MonadMask (ReaderT r m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. ReaderT r m a -> ReaderT r m a) -> ReaderT r m b) -> ReaderT r m b #

uninterruptibleMask :: ((forall a. ReaderT r m a -> ReaderT r m a) -> ReaderT r m b) -> ReaderT r m b #

generalBracket :: ReaderT r m a -> (a -> ExitCase b -> ReaderT r m c) -> (a -> ReaderT r m b) -> ReaderT r m (b, c) #

(Error e, MonadMask m) => MonadMask (ErrorT e m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. ErrorT e m a -> ErrorT e m a) -> ErrorT e m b) -> ErrorT e m b #

uninterruptibleMask :: ((forall a. ErrorT e m a -> ErrorT e m a) -> ErrorT e m b) -> ErrorT e m b #

generalBracket :: ErrorT e m a -> (a -> ExitCase b -> ErrorT e m c) -> (a -> ErrorT e m b) -> ErrorT e m (b, c) #

MonadMask m => MonadMask (IdentityT m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. IdentityT m a -> IdentityT m a) -> IdentityT m b) -> IdentityT m b #

uninterruptibleMask :: ((forall a. IdentityT m a -> IdentityT m a) -> IdentityT m b) -> IdentityT m b #

generalBracket :: IdentityT m a -> (a -> ExitCase b -> IdentityT m c) -> (a -> IdentityT m b) -> IdentityT m (b, c) #

MonadMask m => MonadMask (StateT s m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

uninterruptibleMask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

generalBracket :: StateT s m a -> (a -> ExitCase b -> StateT s m c) -> (a -> StateT s m b) -> StateT s m (b, c) #

(MonadMask m, Monoid w) => MonadMask (WriterT w m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

uninterruptibleMask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

generalBracket :: WriterT w m a -> (a -> ExitCase b -> WriterT w m c) -> (a -> WriterT w m b) -> WriterT w m (b, c) #

MonadMask (CompositionBaseT ts m) => MonadMask (CompositionC ts m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Compose

Methods

mask :: ((forall a. CompositionC ts m a -> CompositionC ts m a) -> CompositionC ts m b) -> CompositionC ts m b #

uninterruptibleMask :: ((forall a. CompositionC ts m a -> CompositionC ts m a) -> CompositionC ts m b) -> CompositionC ts m b #

generalBracket :: CompositionC ts m a -> (a -> ExitCase b -> CompositionC ts m c) -> (a -> CompositionC ts m b) -> CompositionC ts m (b, c) #

Effs ((Mask :: (Type -> Type) -> Type -> Type) ': (Bracket ': ((ErrorIO :: (Type -> Type) -> Type -> Type) ': ([] :: [(Type -> Type) -> Type -> Type])))) m => MonadMask (Effly m) Source # 
Instance details

Defined in Control.Effect.Internal.Effly

Methods

mask :: ((forall a. Effly m a -> Effly m a) -> Effly m b) -> Effly m b #

uninterruptibleMask :: ((forall a. Effly m a -> Effly m a) -> Effly m b) -> Effly m b #

generalBracket :: Effly m a -> (a -> ExitCase b -> Effly m c) -> (a -> Effly m b) -> Effly m (b, c) #

MonadMask m => MonadMask (InterpretPrimSimpleC e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

MonadMask m => MonadMask (InterpretSimpleC e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

mask :: ((forall a. InterpretSimpleC e m a -> InterpretSimpleC e m a) -> InterpretSimpleC e m b) -> InterpretSimpleC e m b #

uninterruptibleMask :: ((forall a. InterpretSimpleC e m a -> InterpretSimpleC e m a) -> InterpretSimpleC e m b) -> InterpretSimpleC e m b #

generalBracket :: InterpretSimpleC e m a -> (a -> ExitCase b -> InterpretSimpleC e m c) -> (a -> InterpretSimpleC e m b) -> InterpretSimpleC e m (b, c) #

MonadMask m => MonadMask (RunMC m) Source # 
Instance details

Defined in Control.Effect.Embed

Methods

mask :: ((forall a. RunMC m a -> RunMC m a) -> RunMC m b) -> RunMC m b #

uninterruptibleMask :: ((forall a. RunMC m a -> RunMC m a) -> RunMC m b) -> RunMC m b #

generalBracket :: RunMC m a -> (a -> ExitCase b -> RunMC m c) -> (a -> RunMC m b) -> RunMC m (b, c) #

(MonadMask m, Monoid s) => MonadMask (WriterLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mask :: ((forall a. WriterLazyC s m a -> WriterLazyC s m a) -> WriterLazyC s m b) -> WriterLazyC s m b #

uninterruptibleMask :: ((forall a. WriterLazyC s m a -> WriterLazyC s m a) -> WriterLazyC s m b) -> WriterLazyC s m b #

generalBracket :: WriterLazyC s m a -> (a -> ExitCase b -> WriterLazyC s m c) -> (a -> WriterLazyC s m b) -> WriterLazyC s m (b, c) #

(MonadMask m, Monoid s) => MonadMask (ListenLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mask :: ((forall a. ListenLazyC s m a -> ListenLazyC s m a) -> ListenLazyC s m b) -> ListenLazyC s m b #

uninterruptibleMask :: ((forall a. ListenLazyC s m a -> ListenLazyC s m a) -> ListenLazyC s m b) -> ListenLazyC s m b #

generalBracket :: ListenLazyC s m a -> (a -> ExitCase b -> ListenLazyC s m c) -> (a -> ListenLazyC s m b) -> ListenLazyC s m (b, c) #

(MonadMask m, Monoid s) => MonadMask (TellLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mask :: ((forall a. TellLazyC s m a -> TellLazyC s m a) -> TellLazyC s m b) -> TellLazyC s m b #

uninterruptibleMask :: ((forall a. TellLazyC s m a -> TellLazyC s m a) -> TellLazyC s m b) -> TellLazyC s m b #

generalBracket :: TellLazyC s m a -> (a -> ExitCase b -> TellLazyC s m c) -> (a -> TellLazyC s m b) -> TellLazyC s m (b, c) #

(Monoid s, MonadMask m) => MonadMask (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mask :: ((forall a. WriterC s m a -> WriterC s m a) -> WriterC s m b) -> WriterC s m b #

uninterruptibleMask :: ((forall a. WriterC s m a -> WriterC s m a) -> WriterC s m b) -> WriterC s m b #

generalBracket :: WriterC s m a -> (a -> ExitCase b -> WriterC s m c) -> (a -> WriterC s m b) -> WriterC s m (b, c) #

(Monoid s, MonadMask m) => MonadMask (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mask :: ((forall a. ListenC s m a -> ListenC s m a) -> ListenC s m b) -> ListenC s m b #

uninterruptibleMask :: ((forall a. ListenC s m a -> ListenC s m a) -> ListenC s m b) -> ListenC s m b #

generalBracket :: ListenC s m a -> (a -> ExitCase b -> ListenC s m c) -> (a -> ListenC s m b) -> ListenC s m (b, c) #

(Monoid s, MonadMask m) => MonadMask (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mask :: ((forall a. TellC s m a -> TellC s m a) -> TellC s m b) -> TellC s m b #

uninterruptibleMask :: ((forall a. TellC s m a -> TellC s m a) -> TellC s m b) -> TellC s m b #

generalBracket :: TellC s m a -> (a -> ExitCase b -> TellC s m c) -> (a -> TellC s m b) -> TellC s m (b, c) #

MonadMask m => MonadMask (UnliftC m) Source # 
Instance details

Defined in Control.Effect.Internal.Unlift

Methods

mask :: ((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b) -> UnliftC m b #

uninterruptibleMask :: ((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b) -> UnliftC m b #

generalBracket :: UnliftC m a -> (a -> ExitCase b -> UnliftC m c) -> (a -> UnliftC m b) -> UnliftC m (b, c) #

MonadMask m => MonadMask (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mask :: ((forall a. StateLazyC s m a -> StateLazyC s m a) -> StateLazyC s m b) -> StateLazyC s m b #

uninterruptibleMask :: ((forall a. StateLazyC s m a -> StateLazyC s m a) -> StateLazyC s m b) -> StateLazyC s m b #

generalBracket :: StateLazyC s m a -> (a -> ExitCase b -> StateLazyC s m c) -> (a -> StateLazyC s m b) -> StateLazyC s m (b, c) #

MonadMask m => MonadMask (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

mask :: ((forall a. StateC s m a -> StateC s m a) -> StateC s m b) -> StateC s m b #

uninterruptibleMask :: ((forall a. StateC s m a -> StateC s m a) -> StateC s m b) -> StateC s m b #

generalBracket :: StateC s m a -> (a -> ExitCase b -> StateC s m c) -> (a -> StateC s m b) -> StateC s m (b, c) #

MonadMask m => MonadMask (HoistC m) Source # 
Instance details

Defined in Control.Effect.Internal.Regional

Methods

mask :: ((forall a. HoistC m a -> HoistC m a) -> HoistC m b) -> HoistC m b #

uninterruptibleMask :: ((forall a. HoistC m a -> HoistC m a) -> HoistC m b) -> HoistC m b #

generalBracket :: HoistC m a -> (a -> ExitCase b -> HoistC m c) -> (a -> HoistC m b) -> HoistC m (b, c) #

MonadMask m => MonadMask (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

mask :: ((forall a. ReaderC i m a -> ReaderC i m a) -> ReaderC i m b) -> ReaderC i m b #

uninterruptibleMask :: ((forall a. ReaderC i m a -> ReaderC i m a) -> ReaderC i m b) -> ReaderC i m b #

generalBracket :: ReaderC i m a -> (a -> ExitCase b -> ReaderC i m c) -> (a -> ReaderC i m b) -> ReaderC i m (b, c) #

MonadMask m => MonadMask (HoistOptionC m) Source # 
Instance details

Defined in Control.Effect.Internal.Optional

Methods

mask :: ((forall a. HoistOptionC m a -> HoistOptionC m a) -> HoistOptionC m b) -> HoistOptionC m b #

uninterruptibleMask :: ((forall a. HoistOptionC m a -> HoistOptionC m a) -> HoistOptionC m b) -> HoistOptionC m b #

generalBracket :: HoistOptionC m a -> (a -> ExitCase b -> HoistOptionC m c) -> (a -> HoistOptionC m b) -> HoistOptionC m (b, c) #

MonadMask m => MonadMask (UnwrapTopC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Newtype

Methods

mask :: ((forall a. UnwrapTopC e m a -> UnwrapTopC e m a) -> UnwrapTopC e m b) -> UnwrapTopC e m b #

uninterruptibleMask :: ((forall a. UnwrapTopC e m a -> UnwrapTopC e m a) -> UnwrapTopC e m b) -> UnwrapTopC e m b #

generalBracket :: UnwrapTopC e m a -> (a -> ExitCase b -> UnwrapTopC e m c) -> (a -> UnwrapTopC e m b) -> UnwrapTopC e m (b, c) #

MonadMask m => MonadMask (UnwrapC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Newtype

Methods

mask :: ((forall a. UnwrapC e m a -> UnwrapC e m a) -> UnwrapC e m b) -> UnwrapC e m b #

uninterruptibleMask :: ((forall a. UnwrapC e m a -> UnwrapC e m a) -> UnwrapC e m b) -> UnwrapC e m b #

generalBracket :: UnwrapC e m a -> (a -> ExitCase b -> UnwrapC e m c) -> (a -> UnwrapC e m b) -> UnwrapC e m (b, c) #

MonadMask m => MonadMask (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mask :: ((forall a. ErrorC e m a -> ErrorC e m a) -> ErrorC e m b) -> ErrorC e m b #

uninterruptibleMask :: ((forall a. ErrorC e m a -> ErrorC e m a) -> ErrorC e m b) -> ErrorC e m b #

generalBracket :: ErrorC e m a -> (a -> ExitCase b -> ErrorC e m c) -> (a -> ErrorC e m b) -> ErrorC e m (b, c) #

MonadMask m => MonadMask (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mask :: ((forall a. ThrowC e m a -> ThrowC e m a) -> ThrowC e m b) -> ThrowC e m b #

uninterruptibleMask :: ((forall a. ThrowC e m a -> ThrowC e m a) -> ThrowC e m b) -> ThrowC e m b #

generalBracket :: ThrowC e m a -> (a -> ExitCase b -> ThrowC e m c) -> (a -> ThrowC e m b) -> ThrowC e m (b, c) #

MonadMask m => MonadMask (BaseControlC m) Source # 
Instance details

Defined in Control.Effect.Internal.BaseControl

Methods

mask :: ((forall a. BaseControlC m a -> BaseControlC m a) -> BaseControlC m b) -> BaseControlC m b #

uninterruptibleMask :: ((forall a. BaseControlC m a -> BaseControlC m a) -> BaseControlC m b) -> BaseControlC m b #

generalBracket :: BaseControlC m a -> (a -> ExitCase b -> BaseControlC m c) -> (a -> BaseControlC m b) -> BaseControlC m (b, c) #

MonadMask m => MonadMask (InterceptRC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Intercept

Methods

mask :: ((forall a. InterceptRC e m a -> InterceptRC e m a) -> InterceptRC e m b) -> InterceptRC e m b #

uninterruptibleMask :: ((forall a. InterceptRC e m a -> InterceptRC e m a) -> InterceptRC e m b) -> InterceptRC e m b #

generalBracket :: InterceptRC e m a -> (a -> ExitCase b -> InterceptRC e m c) -> (a -> InterceptRC e m b) -> InterceptRC e m (b, c) #

MonadMask m => MonadMask (InterpretFailC h m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

mask :: ((forall a. InterpretFailC h m a -> InterpretFailC h m a) -> InterpretFailC h m b) -> InterpretFailC h m b #

uninterruptibleMask :: ((forall a. InterpretFailC h m a -> InterpretFailC h m a) -> InterpretFailC h m b) -> InterpretFailC h m b #

generalBracket :: InterpretFailC h m a -> (a -> ExitCase b -> InterpretFailC h m c) -> (a -> InterpretFailC h m b) -> InterpretFailC h m (b, c) #

MonadMask m => MonadMask (InterpretAltC h m) Source # 
Instance details

Defined in Control.Effect.Alt

Methods

mask :: ((forall a. InterpretAltC h m a -> InterpretAltC h m a) -> InterpretAltC h m b) -> InterpretAltC h m b #

uninterruptibleMask :: ((forall a. InterpretAltC h m a -> InterpretAltC h m a) -> InterpretAltC h m b) -> InterpretAltC h m b #

generalBracket :: InterpretAltC h m a -> (a -> ExitCase b -> InterpretAltC h m c) -> (a -> InterpretAltC h m b) -> InterpretAltC h m (b, c) #

MonadMask m => MonadMask (SubsumeC e m) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

mask :: ((forall a. SubsumeC e m a -> SubsumeC e m a) -> SubsumeC e m b) -> SubsumeC e m b #

uninterruptibleMask :: ((forall a. SubsumeC e m a -> SubsumeC e m a) -> SubsumeC e m b) -> SubsumeC e m b #

generalBracket :: SubsumeC e m a -> (a -> ExitCase b -> SubsumeC e m c) -> (a -> SubsumeC e m b) -> SubsumeC e m (b, c) #

MonadMask m => MonadMask (IntroC top new m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Intro

Methods

mask :: ((forall a. IntroC top new m a -> IntroC top new m a) -> IntroC top new m b) -> IntroC top new m b #

uninterruptibleMask :: ((forall a. IntroC top new m a -> IntroC top new m a) -> IntroC top new m b) -> IntroC top new m b #

generalBracket :: IntroC top new m a -> (a -> ExitCase b -> IntroC top new m c) -> (a -> IntroC top new m b) -> IntroC top new m (b, c) #

MonadMask m => MonadMask (ReinterpretSimpleC e new m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

mask :: ((forall a. ReinterpretSimpleC e new m a -> ReinterpretSimpleC e new m a) -> ReinterpretSimpleC e new m b) -> ReinterpretSimpleC e new m b #

uninterruptibleMask :: ((forall a. ReinterpretSimpleC e new m a -> ReinterpretSimpleC e new m a) -> ReinterpretSimpleC e new m b) -> ReinterpretSimpleC e new m b #

generalBracket :: ReinterpretSimpleC e new m a -> (a -> ExitCase b -> ReinterpretSimpleC e new m c) -> (a -> ReinterpretSimpleC e new m b) -> ReinterpretSimpleC e new m (b, c) #

MonadMask m => MonadMask (InterpretC h e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

mask :: ((forall a. InterpretC h e m a -> InterpretC h e m a) -> InterpretC h e m b) -> InterpretC h e m b #

uninterruptibleMask :: ((forall a. InterpretC h e m a -> InterpretC h e m a) -> InterpretC h e m b) -> InterpretC h e m b #

generalBracket :: InterpretC h e m a -> (a -> ExitCase b -> InterpretC h e m c) -> (a -> InterpretC h e m b) -> InterpretC h e m (b, c) #

MonadMask m => MonadMask (InterpretPrimC s e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

mask :: ((forall a. InterpretPrimC s e m a -> InterpretPrimC s e m a) -> InterpretPrimC s e m b) -> InterpretPrimC s e m b #

uninterruptibleMask :: ((forall a. InterpretPrimC s e m a -> InterpretPrimC s e m a) -> InterpretPrimC s e m b) -> InterpretPrimC s e m b #

generalBracket :: InterpretPrimC s e m a -> (a -> ExitCase b -> InterpretPrimC s e m c) -> (a -> InterpretPrimC s e m b) -> InterpretPrimC s e m (b, c) #

MonadMask m => MonadMask (UnionC l m) Source # 
Instance details

Defined in Control.Effect.Union

Methods

mask :: ((forall a. UnionC l m a -> UnionC l m a) -> UnionC l m b) -> UnionC l m b #

uninterruptibleMask :: ((forall a. UnionC l m a -> UnionC l m a) -> UnionC l m b) -> UnionC l m b #

generalBracket :: UnionC l m a -> (a -> ExitCase b -> UnionC l m c) -> (a -> UnionC l m b) -> UnionC l m (b, c) #

MonadMask m => MonadMask (WrapC e e' m) Source # 
Instance details

Defined in Control.Effect.Internal.Newtype

Methods

mask :: ((forall a. WrapC e e' m a -> WrapC e e' m a) -> WrapC e e' m b) -> WrapC e e' m b #

uninterruptibleMask :: ((forall a. WrapC e e' m a -> WrapC e e' m a) -> WrapC e e' m b) -> WrapC e e' m b #

generalBracket :: WrapC e e' m a -> (a -> ExitCase b -> WrapC e e' m c) -> (a -> WrapC e e' m b) -> WrapC e e' m (b, c) #

(MonadMask m, Monoid w) => MonadMask (RWST r w s m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

uninterruptibleMask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

generalBracket :: RWST r w s m a -> (a -> ExitCase b -> RWST r w s m c) -> (a -> RWST r w s m b) -> RWST r w s m (b, c) #

(MonadMask m, Monoid w) => MonadMask (RWST r w s m) 
Instance details

Defined in Control.Monad.Catch

Methods

mask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

uninterruptibleMask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

generalBracket :: RWST r w s m a -> (a -> ExitCase b -> RWST r w s m c) -> (a -> RWST r w s m b) -> RWST r w s m (b, c) #

MonadMask (t (u m)) => MonadMask (ComposeT t u m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Compose

Methods

mask :: ((forall a. ComposeT t u m a -> ComposeT t u m a) -> ComposeT t u m b) -> ComposeT t u m b #

uninterruptibleMask :: ((forall a. ComposeT t u m a -> ComposeT t u m a) -> ComposeT t u m b) -> ComposeT t u m b #

generalBracket :: ComposeT t u m a -> (a -> ExitCase b -> ComposeT t u m c) -> (a -> ComposeT t u m b) -> ComposeT t u m (b, c) #

(Reifies s (ReifiedEffAlgebra Bracket m), Monad m) => MonadMask (ViaAlg s Bracket m) Source # 
Instance details

Defined in Control.Effect.Type.Bracket

Methods

mask :: ((forall a. ViaAlg s Bracket m a -> ViaAlg s Bracket m a) -> ViaAlg s Bracket m b) -> ViaAlg s Bracket m b #

uninterruptibleMask :: ((forall a. ViaAlg s Bracket m a -> ViaAlg s Bracket m a) -> ViaAlg s Bracket m b) -> ViaAlg s Bracket m b #

generalBracket :: ViaAlg s Bracket m a -> (a -> ExitCase b -> ViaAlg s Bracket m c) -> (a -> ViaAlg s Bracket m b) -> ViaAlg s Bracket m (b, c) #

(Reifies s (ReifiedEffAlgebra (Mask :: (Type -> Type) -> Type -> Type) m), Monad m) => MonadMask (ViaAlg s (Mask :: (Type -> Type) -> Type -> Type) m) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

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) #

MonadMask m => MonadMask (ReinterpretC h e new m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

mask :: ((forall a. ReinterpretC h e new m a -> ReinterpretC h e new m a) -> ReinterpretC h e new m b) -> ReinterpretC h e new m b #

uninterruptibleMask :: ((forall a. ReinterpretC h e new m a -> ReinterpretC h e new m a) -> ReinterpretC h e new m b) -> ReinterpretC h e new m b #

generalBracket :: ReinterpretC h e new m a -> (a -> ExitCase b -> ReinterpretC h e new m c) -> (a -> ReinterpretC h e new m b) -> ReinterpretC h e new m (b, c) #

MonadMask m => MonadMask (UnionizeC b m) Source # 
Instance details

Defined in Control.Effect.Union

Methods

mask :: ((forall a. UnionizeC b m a -> UnionizeC b m a) -> UnionizeC b m b0) -> UnionizeC b m b0 #

uninterruptibleMask :: ((forall a. UnionizeC b m a -> UnionizeC b m a) -> UnionizeC b m b0) -> UnionizeC b m b0 #

generalBracket :: UnionizeC b m a -> (a -> ExitCase b0 -> UnionizeC b m c) -> (a -> UnionizeC b m b0) -> UnionizeC b m (b0, c) #

MonadMask m => MonadMask (ExceptionallyC eff exc m) Source # 
Instance details

Defined in Control.Effect.Exceptional

Methods

mask :: ((forall a. ExceptionallyC eff exc m a -> ExceptionallyC eff exc m a) -> ExceptionallyC eff exc m b) -> ExceptionallyC eff exc m b #

uninterruptibleMask :: ((forall a. ExceptionallyC eff exc m a -> ExceptionallyC eff exc m a) -> ExceptionallyC eff exc m b) -> ExceptionallyC eff exc m b #

generalBracket :: ExceptionallyC eff exc m a -> (a -> ExitCase b -> ExceptionallyC eff exc m c) -> (a -> ExceptionallyC eff exc m b) -> ExceptionallyC eff exc m (b, c) #

MonadMask m => MonadMask (GainBaseControlC b z m) Source # 
Instance details

Defined in Control.Effect.BaseControl

Methods

mask :: ((forall a. GainBaseControlC b z m a -> GainBaseControlC b z m a) -> GainBaseControlC b z m b0) -> GainBaseControlC b z m b0 #

uninterruptibleMask :: ((forall a. GainBaseControlC b z m a -> GainBaseControlC b z m a) -> GainBaseControlC b z m b0) -> GainBaseControlC b z m b0 #

generalBracket :: GainBaseControlC b z m a -> (a -> ExitCase b0 -> GainBaseControlC b z m c) -> (a -> GainBaseControlC b z m b0) -> GainBaseControlC b z m (b0, c) #

Carriers

type IgnoreMaskC = InterpretC IgnoreMaskH Mask Source #