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

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Writer

Contents

Synopsis

Effects

data Tell s m a where Source #

An effect for arbitrary output.

Constructors

Tell :: s -> Tell s m () 
Instances
(Monoid w, Carrier m, Threaders (SteppedThreads ': ([] :: [[Effect] -> Constraint])) m p) => PrimHandler ListenSteppedH (ListenPrim w) (SteppedC (Tell w :: (Type -> Type) -> Type -> Type) m) Source # 
Instance details

Defined in Control.Effect.Internal.Intercept

data Listen s m a where Source #

An effect for hearing what a computation has to tell.

Constructors

Listen :: m a -> Listen s m (s, a) 
Instances
Eff (ListenPrim w) m => Handler ListenSteppedH (Listen w) m Source # 
Instance details

Defined in Control.Effect.Internal.Intercept

data Pass s m a where Source #

An effect for altering what a computation tells.

Constructors

Pass :: m (s -> s, a) -> Pass s m a 

type Writer s = Bundle '[Tell s, Listen s, Pass s] Source #

A pseudo-effect for connected Tell s, Listen s and Pass s effects.

Writer should only ever be used inside of Eff and Effs constraints. It is not a real effect! See Bundle.

Actions

tell :: Eff (Tell s) m => s -> m () Source #

listen :: Eff (Listen s) m => m a -> m (s, a) Source #

pass :: Eff (Pass s) m => m (s -> s, a) -> m a Source #

censor :: Eff (Pass s) m => (s -> s) -> m a -> m a Source #

Interpretations for Tell

runTell :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => TellC s m a -> m (s, a) Source #

Run a Tell s effect, where s is a Monoid, by accumulating all the uses of tell.

You may want to combine this with tellIntoTell.

Unlike runListen and runWriter, this does not provide the ability to interact with the tells through listen and pass; but also doesn't impose any primitive effects, meaning runTell doesn't restrict what interpreters are run before it.

Derivs (TellC s m) = Tell s ': Derivs m
Prims  (TellC s m) = Prims m

This produces the final accumulation s strictly. See runTellLazy for a lazy variant of this.

runTellLazy :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterLazyThreads] m p) => TellLazyC s m a -> m (s, a) Source #

Run a Tell s effect, where s is a Monoid, by accumulating all the uses of tell lazily.

Derivs (TellLazyC s m) = Tell s ': Derivs m
Prims  (TellLazyC s m) = Prims m

This is a variant of runTell that produces the final accumulation lazily. Use this only if you need the laziness, as this would otherwise incur an unneccesary space leak.

runTellList :: forall s m a p. (Carrier m, Threaders '[WriterThreads] m p) => TellListC s m a -> m ([s], a) Source #

Run a Tell s by gathering the tells into a list.

The resulting list is produced strictly. See runTellListLazy for a lazy variant.

runTellListLazy :: forall s m a p. (Carrier m, Threaders '[WriterLazyThreads] m p) => TellListLazyC s m a -> m ([s], a) Source #

Run a Tell s by gathering the tells into a list.

This is a variant of runTellList that produces the final list lazily. Use this only if you need the laziness, as this would otherwise incur an unneccesary space leak.

tellToIO :: forall s m a. (Monoid s, Eff (Embed IO) m) => InterpretReifiedC (Tell s) m a -> m (s, a) Source #

Run a Tell s effect where s is a Monoid by accumulating uses of tell through atomic operations in IO.

You may want to combine this with tellIntoTell.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes tellToIO very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower tellToIOSimple, which doesn't have a higher-rank type.

runTellIORef :: forall s m a. (Monoid s, Eff (Embed IO) m) => IORef s -> InterpretReifiedC (Tell s) m a -> m a Source #

Run a Tell s effect where s is a Monoid by accumulating uses of tell through using atomic operations in IO over the provided IORef.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes runTellIORef very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower runTellIORefSimple, which doesn't have a higher-rank type.

runTellTVar :: forall s m a. (Monoid s, Eff (Embed IO) m) => TVar s -> InterpretReifiedC (Tell s) m a -> m a Source #

Run a Tell s effect where s is a Monoid by accumulating uses of tell through using atomic operations in IO over the provided TVar.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes runTellTVar very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower runTellTVarSimple, which doesn't have a higher-rank type.

tellIntoEndoTell :: (Monoid s, HeadEff (Tell (Endo s)) m) => TellIntoEndoTellC s m a -> m a Source #

Rewrite a Tell s effect into a Tell (Endo s) effect.

This effectively right-associates all uses of tell, which asymptotically improves performance if the time complexity of <> for the Monoid depends only on the size of the first argument. In particular, you should use this (if you can be bothered) if the monoid is a list, such as String.

Usage is to combine this with the Tell interpreter of your choice, followed by fromEndoWriter, like this:

   run
 $ ...
 $ fromEndoWriter
 $ runTell
 $ tellIntoEndoTell @String -- The Monoid must be specified
 $ ...

tellToTell :: forall s t m a. Eff (Tell t) m => (s -> t) -> InterpretReifiedC (Tell s) m a -> m a Source #

Transform a Tell effect into another Tell effect by providing a function to transform the type told.

This is useful to transform a Tell s effect where s isn't a Monoid into a Tell t effect where @@ _is_ a Monoid, and thus can be interpreted using the various Monoidal Tell interpreters.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes tellToTell very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower tellToTellSimple, which doesn't have a higher-rank type.

tellIntoTell :: forall s t m a. HeadEff (Tell t) m => (s -> t) -> ReinterpretReifiedC (Tell s) '[Tell t] m a -> m a Source #

Rewrite a Tell effect into another Tell effect on top of the effect stack by providing a function to transform the type told.

This is useful to rewrite a Tell s effect where s isn't a Monoid into a Tell t effect where t _is_ a Monoid, and thus can be interpreted using the various Monoidal Tell interpreters.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes tellToTell very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower tellIntoTellSimple, which doesn't have a higher-rank type.

Simple variants of interpretations for Tell

tellToIOSimple :: forall s m a p. (Monoid s, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => InterpretSimpleC (Tell s) m a -> m (s, a) Source #

Run a Tell s effect where s is a Monoid by accumulating uses of tell through atomic operations in IO.

You may want to combine this with tellIntoTellSimple.

This is a less performant version of tellToIO that doesn't have a higher-rank type, making it much easier to use partially applied.

runTellIORefSimple :: forall s m a p. (Monoid s, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => IORef s -> InterpretSimpleC (Tell s) m a -> m a Source #

Run a Tell s effect where s is a Monoid by accumulating uses of tell through using atomic operations in IO over the provided IORef.

This is a less performant version of tellToIO that doesn't have a higher-rank type, making it much easier to use partially applied.

runTellTVarSimple :: forall s m a p. (Monoid s, Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => TVar s -> InterpretSimpleC (Tell s) m a -> m a Source #

Run a Tell s effect where s is a Monoid by accumulating uses of tell through using atomic operations in IO over the provided TVar.

This is a less performant version of tellToIO that doesn't have a higher-rank type, making it much easier to use partially applied.

tellToTellSimple :: forall s t m a p. (Eff (Tell t) m, Threaders '[ReaderThreads] m p) => (s -> t) -> InterpretSimpleC (Tell s) m a -> m a Source #

Transform a Tell effect into another Tell effect by providing a function to transform the type told.

This is useful to transform a Tell s where s isn't a Monoid into a Tell t effect where @@ _is_ a Monoid, and thus can be interpreted using the various Monoidal Tell interpreters.

This is a less performant version of tellToTell that doesn't have a higher-rank type, making it much easier to use partially applied.

tellIntoTellSimple :: forall s t m a p. (HeadEff (Tell t) m, Threaders '[ReaderThreads] m p) => (s -> t) -> ReinterpretSimpleC (Tell s) '[Tell t] m a -> m a Source #

Rewrite a Tell effect into another Tell effect on top of the effect stack by providing a function to transform the type told.

This is useful to rewrite a Tell s effect where s isn't a Monoid into a Tell t effect where @@ _is_ a Monoid, and thus can be interpreted using the various Monoidal Tell interpreters.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes tellToTell very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower tellIntoTellSimple, which doesn't have a higher-rank type.

This is a less performant version of tellIntoTell that doesn't have a higher-rank type, making it much easier to use partially applied.

Interpretations for Tell + Listen

runListen :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => ListenC s m a -> m (s, a) Source #

Run connected Listen s and Tell s effects, where s is a Monoid, by accumulating all the uses of tell.

Unlike runWriter, this does not provide the power of pass; but because of that, it also doesn't impose Pass as a primitive effect, meaning a larger variety of interpreters may be run before runListen compared to runWriter.

Derivs (ListenC s m) = Listen s ': Tell s ': Derivs m
Prims  (ListenC s m) = ListenPrim s ': Prims m

This produces the final accumulation strictly. See runListenLazy for a lazy variant of this.

runListenLazy :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => ListenLazyC s m a -> m (s, a) Source #

Run connected Listen s and Tell s effects, where s is a Monoid, by accumulating all the uses of tell lazily.

Derivs (ListenLazyC s m) = Listen s ': Tell s ': Derivs m
Prims  (ListenLazyC s m) = ListenPrim s ': Prims m

This is a variant of runListen that produces the final accumulation lazily. Use this only if you need the laziness, as this would otherwise incur an unneccesary space leak.

listenToIO :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => ListenTVarC s m a -> m (s, a) Source #

Run connected Listen s and Tell s effects by accumulating uses of tell through using atomic operations in IO.

Derivs (ListenTVarC s m) = Listen s ': Tell s ': Derivs m
Prims  (ListenTVarC s m) = ListenPrim s ': ReaderPrim (s -> STM ()) ': Prims m

Note that unlike tellToIO, this does not have a higher-rank type.

runListenTVar :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => TVar s -> ListenTVarC s m a -> m a Source #

Run connected Listen s and Tell s effects by accumulating uses of tell through using atomic operations in IO over the provided TVar.

Derivs (ListenTVarC s m) = Listen s : Tell s ': Derivs m
Prims  (ListenTVarC s m) = ListenPrim s ': ReaderPrim (s -> STM ()) ': Prims m

Note that unlike runTellTVar, this does not have a higher-rank type.

listenIntoEndoListen :: (Monoid s, HeadEffs '[Listen (Endo s), Tell (Endo s)] m) => ListenIntoEndoListenC s m a -> m a Source #

Rewrite connected Listen s and Tell s effects into connected Listen (Endo s) and Tell (Endo s) effects.

This effectively right-associates all uses of tell, which asymptotically improves performance if the time complexity of <> for the Monoid depends only on the size of the first argument. In particular, you should use this (if you can be bothered) if the monoid is a list, such as String.

Usage is to combine this with the Listen interpreter of your choice, followed by fromEndoWriter, like this:

   run
 $ ...
 $ fromEndoWriter
 $ runListen
 $ listenIntoEndoListen @String -- The Monoid must be specified
 $ ...

Interpretations for Writer (Tell + Listen + Pass)

runWriter :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterThreads] m p) => WriterC s m a -> m (s, a) Source #

Run connected Pass s, Listen s and Tell s effects, -- i.e. Writer s -- where s is a Monoid, by accumulating all the uses of tell.

Pass s is a fairly restrictive primitive effect. Notably, runCont can't be used before runWriter. If you don't need pass, consider using runTell or runListen instead.

Derivs (WriterC s m) = Pass s ': Listen s ': Tell s ': Derivs m
Prims  (WriterC s m) = WriterPrim s ': Prims m

This produces the final accumulation strictly. See runWriterLazy for a lazy variant of this.

runWriterLazy :: forall s m a p. (Monoid s, Carrier m, Threaders '[WriterLazyThreads] m p) => WriterLazyC s m a -> m (s, a) Source #

Run connected Pass s, Listen s and Tell s effects, -- i.e. Writer s -- where s is a Monoid, by accumulating all the uses of tell lazily.

Derivs (ListenLazyC s m) = Pass s ': Listen s ': Tell s ': Derivs m
Prims  (ListenLazyC s m) = WriterPrim s ': Prims m

This is a variant of runListen that produces the final accumulation lazily. Use this only if you need the laziness, as this would otherwise incur an unneccesary space leak.

writerToIO :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => WriterTVarC s m a -> m (s, a) Source #

Run connected Pass s, Listen s and Tell s effects -- i.e. Writer s -- by accumulating uses of tell through using atomic operations in IO.

Derivs (WriterTVarC s m) = Pass s ': Listen s : Tell s ': Derivs m
Prims  (WriterTVarC s m) = WriterPrim s ': ReaderPrim (s -> STM ()) ': Prims m

Note that unlike tellToIO, this does not have a higher-rank type.

runWriterTVar :: forall s m a p. (Monoid s, Eff (Embed IO) m, MonadMask m, Threaders '[ReaderThreads] m p) => TVar s -> WriterTVarC s m a -> m a Source #

Run connected Pass s, Listen s and Tell s effects -- i.e. Writer s -- by accumulating uses of tell through using atomic operations in IO over a TVar.

Derivs (WriterTVarC s m) = Pass s ': Listen s : Tell s ': Derivs m
Prims  (WriterTVarC s m) = WriterPrim s ': ReaderPrim (s -> STM ()) ': Prims m

Note that unlike runTellTVar, this does not have a higher-rank type.

writerToBracket :: forall s m a p. (Monoid s, Effs [Embed IO, Bracket] m, Threaders '[ReaderThreads] m p) => WriterToBracketC s m a -> m (s, a) Source #

Run connected Pass s, Listen s and Tell s effects -- i.e. Writer s -- by accumulating uses of tell through using atomic operations in IO, relying on the provided protection of Bracket for the implementation.

Derivs (WriterToBracketC s m) = Pass s ': Listen s : Tell s ': Derivs m
Prims  (WriterToBracketC s m) = ReaderPrim (s -> STM ()) ': Prims m

Note that unlike writerToIO, this does not have a higher-rank type.

writerToBracketTVar :: forall s m a p. (Monoid s, Effs [Embed IO, Bracket] m, Threaders '[ReaderThreads] m p) => TVar s -> WriterToBracketC s m a -> m a Source #

Run connected Pass s, Listen s and Tell s effects -- i.e. Writer s -- by accumulating uses of tell through using atomic operations in IO over a TVar, relying on the provided protection of Bracket for the implementation.

Derivs (WriterToBracketC s m) = Pass s ': Listen s : Tell s ': Derivs m
Prims  (WriterToBracketC s m) = ReaderPrim (s -> STM ()) ': Prims m

Note that unlike runTellTVar, this does not have a higher-rank type.

writerIntoEndoWriter :: (Monoid s, HeadEffs '[Pass (Endo s), Listen (Endo s), Tell (Endo s)] m) => WriterIntoEndoWriterC s m a -> m a Source #

Rewrite connected Pass s, Listen s and Tell s effects -- i.e. Writer s -- into connected Pass (Endo s), Listen (Endo s) and Tell (Endo s) effects on top of the effect stack -- i.e. Writer (Endo s).

This effectively right-associates all uses of tell, which asymptotically improves performance if the time complexity of <> for the Monoid depends only on the size of the first argument. In particular, you should use this (if you can be bothered) if the monoid is a list, such as String.

Usage is to combine this with the Writer interpreter of your choice, followed by fromEndoWriter, like this:

   run
 $ ...
 $ fromEndoWriter
 $ runWriter
 $ writerIntoEndoWriter @String -- The Monoid must be specified
 $ ...

Other utilities

fromEndoWriter :: (Monoid s, Functor f) => f (Endo s, a) -> f (s, a) Source #

Threading constraints

class (forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p Source #

WriterThreads accepts the following primitive effects:

Instances
(forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p Source # 
Instance details

Defined in Control.Effect.Internal.Writer

class (forall s. Monoid s => Threads (WriterT s) p) => WriterLazyThreads p Source #

WriterLazyThreads accepts the following primitive effects:

Instances
(forall s. Monoid s => Threads (WriterT s) p) => WriterLazyThreads p Source # 
Instance details

Defined in Control.Effect.Internal.Writer

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

data TellC s m a Source #

Instances
MonadBase b m => MonadBase b (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftBase :: b α -> TellC s m α #

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

Defined in Control.Effect.Internal.Writer

Associated Types

type StM (TellC s m) a :: Type #

Methods

liftBaseWith :: (RunInBase (TellC s m) b -> b a) -> TellC s m a #

restoreM :: StM (TellC s m) a -> TellC s m a #

MonadTrans (TellC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

lift :: Monad m => m a -> TellC s m a #

Monoid s => MonadTransControl (TellC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type StT (TellC s) a :: Type #

Methods

liftWith :: Monad m => (Run (TellC s) -> m a) -> TellC s m a #

restoreT :: Monad m => m (StT (TellC s) a) -> TellC s m a #

Monad m => Monad (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

(>>=) :: TellC s m a -> (a -> TellC s m b) -> TellC s m b #

(>>) :: TellC s m a -> TellC s m b -> TellC s m b #

return :: a -> TellC s m a #

fail :: String -> TellC s m a #

Functor m => Functor (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fmap :: (a -> b) -> TellC s m a -> TellC s m b #

(<$) :: a -> TellC s m b -> TellC s m a #

MonadFix m => MonadFix (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mfix :: (a -> TellC s m a) -> TellC s m a #

MonadFail m => MonadFail (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fail :: String -> TellC s m a #

Monad m => Applicative (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

pure :: a -> TellC s m a #

(<*>) :: TellC s m (a -> b) -> TellC s m a -> TellC s m b #

liftA2 :: (a -> b -> c) -> TellC s m a -> TellC s m b -> TellC s m c #

(*>) :: TellC s m a -> TellC s m b -> TellC s m b #

(<*) :: TellC s m a -> TellC s m b -> TellC s m a #

MonadIO m => MonadIO (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftIO :: IO a -> TellC s m a #

MonadPlus m => Alternative (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

empty :: TellC s m a #

(<|>) :: TellC s m a -> TellC s m a -> TellC s m a #

some :: TellC s m a -> TellC s m [a] #

many :: TellC s m a -> TellC s m [a] #

MonadPlus m => MonadPlus (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mzero :: TellC s m a #

mplus :: TellC s m a -> TellC s m a -> TellC s m a #

MonadThrow m => MonadThrow (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

throwM :: Exception e => e -> TellC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

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

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

(Carrier m, Monoid s, Threads (WriterT s) (Prims m)) => Carrier (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type Derivs (TellC s m) :: [Effect] Source #

type Prims (TellC s m) :: [Effect] Source #

Methods

algPrims :: Algebra' (Prims (TellC s m)) (TellC s m) a Source #

reformulate :: Monad z => Reformulation' (Derivs (TellC s m)) (Prims (TellC s m)) (TellC s m) z a Source #

algDerivs :: Algebra' (Derivs (TellC s m)) (TellC s m) a Source #

type StT (TellC s) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StT (TellC s) a = (a, s)
type Derivs (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Derivs (TellC s m) = (Tell s :: (Type -> Type) -> Type -> Type) ': Derivs m
type Prims (TellC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Prims (TellC s m) = Prims m
type StM (TellC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StM (TellC s m) a = StM m (a, s)

data TellLazyC s m a Source #

Instances
(Monoid s, MonadBase b m) => MonadBase b (TellLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftBase :: b α -> TellLazyC s m α #

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

Defined in Control.Effect.Internal.Writer

Associated Types

type StM (TellLazyC s m) a :: Type #

Methods

liftBaseWith :: (RunInBase (TellLazyC s m) b -> b a) -> TellLazyC s m a #

restoreM :: StM (TellLazyC s m) a -> TellLazyC s m a #

Monoid s => MonadTrans (TellLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

lift :: Monad m => m a -> TellLazyC s m a #

Monoid s => MonadTransControl (TellLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type StT (TellLazyC s) a :: Type #

Methods

liftWith :: Monad m => (Run (TellLazyC s) -> m a) -> TellLazyC s m a #

restoreT :: Monad m => m (StT (TellLazyC s) a) -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

(>>=) :: TellLazyC s m a -> (a -> TellLazyC s m b) -> TellLazyC s m b #

(>>) :: TellLazyC s m a -> TellLazyC s m b -> TellLazyC s m b #

return :: a -> TellLazyC s m a #

fail :: String -> TellLazyC s m a #

Functor m => Functor (TellLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fmap :: (a -> b) -> TellLazyC s m a -> TellLazyC s m b #

(<$) :: a -> TellLazyC s m b -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

mfix :: (a -> TellLazyC s m a) -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

fail :: String -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

pure :: a -> TellLazyC s m a #

(<*>) :: TellLazyC s m (a -> b) -> TellLazyC s m a -> TellLazyC s m b #

liftA2 :: (a -> b -> c) -> TellLazyC s m a -> TellLazyC s m b -> TellLazyC s m c #

(*>) :: TellLazyC s m a -> TellLazyC s m b -> TellLazyC s m b #

(<*) :: TellLazyC s m a -> TellLazyC s m b -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

liftIO :: IO a -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

empty :: TellLazyC s m a #

(<|>) :: TellLazyC s m a -> TellLazyC s m a -> TellLazyC s m a #

some :: TellLazyC s m a -> TellLazyC s m [a] #

many :: TellLazyC s m a -> TellLazyC s m [a] #

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

Defined in Control.Effect.Internal.Writer

Methods

mzero :: TellLazyC s m a #

mplus :: TellLazyC s m a -> TellLazyC s m a -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

throwM :: Exception e => e -> TellLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

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

(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, Carrier m, Threads (WriterT s) (Prims m)) => Carrier (TellLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type Derivs (TellLazyC s m) :: [Effect] Source #

type Prims (TellLazyC s m) :: [Effect] Source #

type StT (TellLazyC s) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StT (TellLazyC s) a = StT (WriterT s) a
type Derivs (TellLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Derivs (TellLazyC s m) = (Tell s :: (Type -> Type) -> Type -> Type) ': Derivs m
type Prims (TellLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Prims (TellLazyC s m) = Prims m
type StM (TellLazyC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StM (TellLazyC s m) a = StM (WriterT s m) a

type TellListC s = CompositionC '[ReinterpretC TellListH (Tell s) '[Tell (Dual [s])], TellC (Dual [s])] Source #

type TellListLazyC s = CompositionC '[ReinterpretC TellListLazyH (Tell s) '[Tell (Endo [s])], TellLazyC (Endo [s])] Source #

type TellIntoEndoTellC s = ReinterpretC WriterToEndoWriterH (Tell s) '[Tell (Endo s)] Source #

data ListenC s m a Source #

Instances
MonadBase b m => MonadBase b (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftBase :: b α -> ListenC s m α #

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

Defined in Control.Effect.Internal.Writer

Associated Types

type StM (ListenC s m) a :: Type #

Methods

liftBaseWith :: (RunInBase (ListenC s m) b -> b a) -> ListenC s m a #

restoreM :: StM (ListenC s m) a -> ListenC s m a #

MonadTrans (ListenC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

lift :: Monad m => m a -> ListenC s m a #

Monoid s => MonadTransControl (ListenC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type StT (ListenC s) a :: Type #

Methods

liftWith :: Monad m => (Run (ListenC s) -> m a) -> ListenC s m a #

restoreT :: Monad m => m (StT (ListenC s) a) -> ListenC s m a #

Monad m => Monad (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

(>>=) :: ListenC s m a -> (a -> ListenC s m b) -> ListenC s m b #

(>>) :: ListenC s m a -> ListenC s m b -> ListenC s m b #

return :: a -> ListenC s m a #

fail :: String -> ListenC s m a #

Functor m => Functor (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fmap :: (a -> b) -> ListenC s m a -> ListenC s m b #

(<$) :: a -> ListenC s m b -> ListenC s m a #

MonadFix m => MonadFix (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mfix :: (a -> ListenC s m a) -> ListenC s m a #

MonadFail m => MonadFail (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fail :: String -> ListenC s m a #

Monad m => Applicative (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

pure :: a -> ListenC s m a #

(<*>) :: ListenC s m (a -> b) -> ListenC s m a -> ListenC s m b #

liftA2 :: (a -> b -> c) -> ListenC s m a -> ListenC s m b -> ListenC s m c #

(*>) :: ListenC s m a -> ListenC s m b -> ListenC s m b #

(<*) :: ListenC s m a -> ListenC s m b -> ListenC s m a #

MonadIO m => MonadIO (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftIO :: IO a -> ListenC s m a #

MonadPlus m => Alternative (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

empty :: ListenC s m a #

(<|>) :: ListenC s m a -> ListenC s m a -> ListenC s m a #

some :: ListenC s m a -> ListenC s m [a] #

many :: ListenC s m a -> ListenC s m [a] #

MonadPlus m => MonadPlus (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mzero :: ListenC s m a #

mplus :: ListenC s m a -> ListenC s m a -> ListenC s m a #

MonadThrow m => MonadThrow (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

throwM :: Exception e => e -> ListenC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

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

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

(Carrier m, Monoid s, Threads (WriterT s) (Prims m)) => Carrier (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type Derivs (ListenC s m) :: [Effect] Source #

type Prims (ListenC s m) :: [Effect] Source #

type StT (ListenC s) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StT (ListenC s) a = StT (TellC s) a
type Derivs (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Derivs (ListenC s m) = Listen s ': ((Tell s :: (Type -> Type) -> Type -> Type) ': Derivs m)
type Prims (ListenC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Prims (ListenC s m) = ListenPrim s ': Prims m
type StM (ListenC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StM (ListenC s m) a = StM (TellC s m) a

data ListenLazyC s m a Source #

Instances
(Monoid s, MonadBase b m) => MonadBase b (ListenLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftBase :: b α -> ListenLazyC s m α #

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

Defined in Control.Effect.Internal.Writer

Associated Types

type StM (ListenLazyC s m) a :: Type #

Methods

liftBaseWith :: (RunInBase (ListenLazyC s m) b -> b a) -> ListenLazyC s m a #

restoreM :: StM (ListenLazyC s m) a -> ListenLazyC s m a #

Monoid s => MonadTrans (ListenLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

lift :: Monad m => m a -> ListenLazyC s m a #

Monoid s => MonadTransControl (ListenLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type StT (ListenLazyC s) a :: Type #

Methods

liftWith :: Monad m => (Run (ListenLazyC s) -> m a) -> ListenLazyC s m a #

restoreT :: Monad m => m (StT (ListenLazyC s) a) -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

(>>=) :: ListenLazyC s m a -> (a -> ListenLazyC s m b) -> ListenLazyC s m b #

(>>) :: ListenLazyC s m a -> ListenLazyC s m b -> ListenLazyC s m b #

return :: a -> ListenLazyC s m a #

fail :: String -> ListenLazyC s m a #

Functor m => Functor (ListenLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fmap :: (a -> b) -> ListenLazyC s m a -> ListenLazyC s m b #

(<$) :: a -> ListenLazyC s m b -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

mfix :: (a -> ListenLazyC s m a) -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

fail :: String -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

pure :: a -> ListenLazyC s m a #

(<*>) :: ListenLazyC s m (a -> b) -> ListenLazyC s m a -> ListenLazyC s m b #

liftA2 :: (a -> b -> c) -> ListenLazyC s m a -> ListenLazyC s m b -> ListenLazyC s m c #

(*>) :: ListenLazyC s m a -> ListenLazyC s m b -> ListenLazyC s m b #

(<*) :: ListenLazyC s m a -> ListenLazyC s m b -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

liftIO :: IO a -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

empty :: ListenLazyC s m a #

(<|>) :: ListenLazyC s m a -> ListenLazyC s m a -> ListenLazyC s m a #

some :: ListenLazyC s m a -> ListenLazyC s m [a] #

many :: ListenLazyC s m a -> ListenLazyC s m [a] #

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

Defined in Control.Effect.Internal.Writer

Methods

mzero :: ListenLazyC s m a #

mplus :: ListenLazyC s m a -> ListenLazyC s m a -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

throwM :: Exception e => e -> ListenLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

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

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

(Monoid s, Carrier m, Threads (WriterT s) (Prims m)) => Carrier (ListenLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type Derivs (ListenLazyC s m) :: [Effect] Source #

type Prims (ListenLazyC s m) :: [Effect] Source #

type StT (ListenLazyC s) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StT (ListenLazyC s) a = StT (WriterT s) a
type Derivs (ListenLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Derivs (ListenLazyC s m) = Listen s ': ((Tell s :: (Type -> Type) -> Type -> Type) ': Derivs m)
type Prims (ListenLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Prims (ListenLazyC s m) = ListenPrim s ': Prims m
type StM (ListenLazyC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StM (ListenLazyC s m) a = StM (WriterT s m) a

type ListenTVarC s = CompositionC '[IntroC '[Listen s, Tell s] '[ListenPrim s, Local (s -> STM ()), Ask (s -> STM ())], InterpretC WriterTVarH (Listen s), InterpretC WriterTVarH (Tell s), InterpretPrimC WriterTVarH (ListenPrim s), ReaderC (s -> STM ())] Source #

type ListenIntoEndoListenC s = CompositionC '[IntroC '[Listen s, Tell s] '[Listen (Endo s), Tell (Endo s)], InterpretC WriterToEndoWriterH (Listen s), InterpretC WriterToEndoWriterH (Tell s)] Source #

data WriterC s m a Source #

Instances
MonadBase b m => MonadBase b (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftBase :: b α -> WriterC s m α #

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

Defined in Control.Effect.Internal.Writer

Associated Types

type StM (WriterC s m) a :: Type #

Methods

liftBaseWith :: (RunInBase (WriterC s m) b -> b a) -> WriterC s m a #

restoreM :: StM (WriterC s m) a -> WriterC s m a #

MonadTrans (WriterC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

lift :: Monad m => m a -> WriterC s m a #

Monoid s => MonadTransControl (WriterC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type StT (WriterC s) a :: Type #

Methods

liftWith :: Monad m => (Run (WriterC s) -> m a) -> WriterC s m a #

restoreT :: Monad m => m (StT (WriterC s) a) -> WriterC s m a #

Monad m => Monad (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

(>>=) :: WriterC s m a -> (a -> WriterC s m b) -> WriterC s m b #

(>>) :: WriterC s m a -> WriterC s m b -> WriterC s m b #

return :: a -> WriterC s m a #

fail :: String -> WriterC s m a #

Functor m => Functor (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fmap :: (a -> b) -> WriterC s m a -> WriterC s m b #

(<$) :: a -> WriterC s m b -> WriterC s m a #

MonadFix m => MonadFix (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mfix :: (a -> WriterC s m a) -> WriterC s m a #

MonadFail m => MonadFail (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fail :: String -> WriterC s m a #

Monad m => Applicative (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

pure :: a -> WriterC s m a #

(<*>) :: WriterC s m (a -> b) -> WriterC s m a -> WriterC s m b #

liftA2 :: (a -> b -> c) -> WriterC s m a -> WriterC s m b -> WriterC s m c #

(*>) :: WriterC s m a -> WriterC s m b -> WriterC s m b #

(<*) :: WriterC s m a -> WriterC s m b -> WriterC s m a #

MonadIO m => MonadIO (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftIO :: IO a -> WriterC s m a #

MonadPlus m => Alternative (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

empty :: WriterC s m a #

(<|>) :: WriterC s m a -> WriterC s m a -> WriterC s m a #

some :: WriterC s m a -> WriterC s m [a] #

many :: WriterC s m a -> WriterC s m [a] #

MonadPlus m => MonadPlus (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

mzero :: WriterC s m a #

mplus :: WriterC s m a -> WriterC s m a -> WriterC s m a #

MonadThrow m => MonadThrow (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

throwM :: Exception e => e -> WriterC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

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

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

(Carrier m, Monoid s, Threads (WriterT s) (Prims m)) => Carrier (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type Derivs (WriterC s m) :: [Effect] Source #

type Prims (WriterC s m) :: [Effect] Source #

type StT (WriterC s) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StT (WriterC s) a = StT (TellC s) a
type Derivs (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Derivs (WriterC s m) = Pass s ': (Listen s ': ((Tell s :: (Type -> Type) -> Type -> Type) ': Derivs m))
type Prims (WriterC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Prims (WriterC s m) = WriterPrim s ': Prims m
type StM (WriterC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StM (WriterC s m) a = StM (TellC s m) a

data WriterLazyC s m a Source #

Instances
(Monoid s, MonadBase b m) => MonadBase b (WriterLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

liftBase :: b α -> WriterLazyC s m α #

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

Defined in Control.Effect.Internal.Writer

Associated Types

type StM (WriterLazyC s m) a :: Type #

Methods

liftBaseWith :: (RunInBase (WriterLazyC s m) b -> b a) -> WriterLazyC s m a #

restoreM :: StM (WriterLazyC s m) a -> WriterLazyC s m a #

Monoid s => MonadTrans (WriterLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

lift :: Monad m => m a -> WriterLazyC s m a #

Monoid s => MonadTransControl (WriterLazyC s) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type StT (WriterLazyC s) a :: Type #

Methods

liftWith :: Monad m => (Run (WriterLazyC s) -> m a) -> WriterLazyC s m a #

restoreT :: Monad m => m (StT (WriterLazyC s) a) -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

(>>=) :: WriterLazyC s m a -> (a -> WriterLazyC s m b) -> WriterLazyC s m b #

(>>) :: WriterLazyC s m a -> WriterLazyC s m b -> WriterLazyC s m b #

return :: a -> WriterLazyC s m a #

fail :: String -> WriterLazyC s m a #

Functor m => Functor (WriterLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

fmap :: (a -> b) -> WriterLazyC s m a -> WriterLazyC s m b #

(<$) :: a -> WriterLazyC s m b -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

mfix :: (a -> WriterLazyC s m a) -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

fail :: String -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

pure :: a -> WriterLazyC s m a #

(<*>) :: WriterLazyC s m (a -> b) -> WriterLazyC s m a -> WriterLazyC s m b #

liftA2 :: (a -> b -> c) -> WriterLazyC s m a -> WriterLazyC s m b -> WriterLazyC s m c #

(*>) :: WriterLazyC s m a -> WriterLazyC s m b -> WriterLazyC s m b #

(<*) :: WriterLazyC s m a -> WriterLazyC s m b -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

liftIO :: IO a -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

empty :: WriterLazyC s m a #

(<|>) :: WriterLazyC s m a -> WriterLazyC s m a -> WriterLazyC s m a #

some :: WriterLazyC s m a -> WriterLazyC s m [a] #

many :: WriterLazyC s m a -> WriterLazyC s m [a] #

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

Defined in Control.Effect.Internal.Writer

Methods

mzero :: WriterLazyC s m a #

mplus :: WriterLazyC s m a -> WriterLazyC s m a -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

throwM :: Exception e => e -> WriterLazyC s m a #

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

Defined in Control.Effect.Internal.Writer

Methods

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

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

(Monoid s, Carrier m, Threads (WriterT s) (Prims m)) => Carrier (WriterLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Associated Types

type Derivs (WriterLazyC s m) :: [Effect] Source #

type Prims (WriterLazyC s m) :: [Effect] Source #

type StT (WriterLazyC s) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StT (WriterLazyC s) a = StT (WriterT s) a
type Derivs (WriterLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Derivs (WriterLazyC s m) = Pass s ': (Listen s ': ((Tell s :: (Type -> Type) -> Type -> Type) ': Derivs m))
type Prims (WriterLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type Prims (WriterLazyC s m) = WriterPrim s ': Prims m
type StM (WriterLazyC s m) a Source # 
Instance details

Defined in Control.Effect.Internal.Writer

type StM (WriterLazyC s m) a = StM (WriterT s m) a

type WriterTVarC s = CompositionC '[IntroC '[Pass s, Listen s, Tell s] '[ListenPrim s, WriterPrim s, Local (s -> STM ()), Ask (s -> STM ())], InterpretC WriterTVarH (Pass s), InterpretC WriterTVarH (Listen s), InterpretC WriterTVarH (Tell s), InterpretC WriterTVarH (ListenPrim s), InterpretPrimC WriterTVarH (WriterPrim s), ReaderC (s -> STM ())] Source #

type WriterToBracketC s = CompositionC '[IntroC '[Pass s, Listen s, Tell s] '[Local (s -> STM ()), Ask (s -> STM ())], InterpretC WriterToBracketH (Pass s), InterpretC WriterToBracketH (Listen s), InterpretC WriterTVarH (Tell s), ReaderC (s -> STM ())] Source #

type WriterIntoEndoWriterC s = CompositionC '[IntroC '[Pass s, Listen s, Tell s] '[Pass (Endo s), Listen (Endo s), Tell (Endo s)], InterpretC WriterToEndoWriterH (Pass s), InterpretC WriterToEndoWriterH (Listen s), InterpretC WriterToEndoWriterH (Tell s)] Source #