Copyright | (c) Michael Szvetits 2020 |
---|---|
License | BSD3 (see the file LICENSE) |
Maintainer | typedbyte@qualified.name |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Lazy 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
- evalRWS' :: forall tag r w s m a. Functor m => 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 => 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 => 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 => 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 => 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 => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] `EachVia` RWST r w s) m a -> m (w, s, a)
Tagged Interpretations
:: forall tag r w s m a. Functor m | |
=> 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 | |
=> 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 | |
=> 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 => 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'
.