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