Copyright | (c) Michael Szvetits 2020 |
---|---|
License | BSD3 (see the file LICENSE) |
Maintainer | typedbyte@qualified.name |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Strict interpretations of the RWS'
effect.
If you don't require disambiguation of multiple RWS effects (i.e., you only have one RWS effect in your monadic context), you usually need the untagged interpretations.
Synopsis
- data RWST r w s m a
- evalRWS' :: forall tag r w s m a. (Functor m, Monoid w) => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, a)
- execRWS' :: forall tag r w s m a. (Functor m, Monoid w) => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, s)
- runRWS' :: forall tag r w s m a. (Functor m, Monoid w) => r -> s -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a -> m (w, s, a)
- evalRWS :: (Functor m, Monoid w) => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, a)
- execRWS :: (Functor m, Monoid w) => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, s)
- runRWS :: (Functor m, Monoid w) => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, s, a)
Interpreter Type
The strict interpreter of the RWS effect. This type implements the
RWS'
type class in a strict manner.
When interpreting the effect, you usually don't interact with this type directly, but instead use one of its corresponding interpretation functions.
Instances
(Monad m, Monoid w) => RWS' (tag :: k) r w s (RWST r w s m) Source # | |
Defined in Control.Effect.RWS.Strict | |
Monad m => Reader' (tag :: k) r (RWST r w s m) Source # | |
Monad m => State' (tag :: k) s (RWST r w s m) Source # | |
(Monad m, Monoid w) => Writer' (tag :: k) w (RWST r w s m) Source # | |
MonadBase b m => MonadBase b (RWST r w s m) Source # | |
Defined in Control.Effect.RWS.Strict | |
(MonadBaseControl b m, Monoid w) => MonadBaseControl b (RWST r w s m) Source # | |
MonadTrans (RWST r w s) Source # | |
Defined in Control.Effect.RWS.Strict | |
Monoid w => MonadTransControl (RWST r w s) Source # | |
Monad m => Monad (RWST r w s m) Source # | |
Functor m => Functor (RWST r w s m) Source # | |
Monad m => Applicative (RWST r w s m) Source # | |
Defined in Control.Effect.RWS.Strict | |
MonadIO m => MonadIO (RWST r w s m) Source # | |
Defined in Control.Effect.RWS.Strict | |
type StT (RWST r w s) a Source # | |
Defined in Control.Effect.RWS.Strict | |
type StM (RWST r w s m) a Source # | |
Defined in Control.Effect.RWS.Strict |
Tagged Interpretations
:: forall tag r w s m a. (Functor m, Monoid w) | |
=> r | The initial environment. |
-> s | The initial state. |
-> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a | The program whose RWS effect should be handled. |
-> m (w, a) | The program with its RWS effect handled, producing the final
output |
Runs the RWS effect and discards the final state.
:: forall tag r w s m a. (Functor m, Monoid w) | |
=> r | The initial environment. |
-> s | The initial state. |
-> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a | The program whose RWS effect should be handled. |
-> m (w, s) | The program with its RWS effect handled, producing the final
output |
Runs the RWS effect and discards the result of the interpreted program.
:: forall tag r w s m a. (Functor m, Monoid w) | |
=> r | The initial environment. |
-> s | The initial state. |
-> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] `EachVia` RWST r w s) m a | The program whose RWS effect should be handled. |
-> m (w, s, a) | The program with its RWS effect handled, producing the final
output |
Runs the RWS effect and returns the final output, the final state and the result of the interpreted program.
Untagged Interpretations
evalRWS :: (Functor m, Monoid w) => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, a) Source #
The untagged version of evalRWS'
.