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 Writer'
effect.
If you don't require disambiguation of multiple writer effects (i.e., you only have one writer effect in your monadic context), you usually need the untagged interpretations.
Synopsis
- execWriter' :: forall tag w m a. Monad m => (Writer' tag w `Via` WriterT w) m a -> m w
- runWriter' :: forall tag w m a. Functor m => (Writer' tag w `Via` WriterT w) m a -> m (w, a)
- execWriter :: Monad m => (Writer w `Via` WriterT w) m a -> m w
- runWriter :: Functor m => (Writer w `Via` WriterT w) m a -> m (w, a)
Tagged Interpretations
:: forall tag w m a. Monad m | |
=> (Writer' tag w `Via` WriterT w) m a | The program whose writer effect should be handled. |
-> m w | The program with its writer effect handled, producing the final output |
Runs the writer effect and returns the final output.
:: forall tag w m a. Functor m | |
=> (Writer' tag w `Via` WriterT w) m a | The program whose writer effect should be handled. |
-> m (w, a) | The program with its writer effect handled, producing the final output |
Runs the writer effect and returns both the final output and the result of the interpreted program.
Untagged Interpretations
execWriter :: Monad m => (Writer w `Via` WriterT w) m a -> m w Source #
The untagged version of execWriter'
.