state package:dunai

Construct a state monad computation from a state transformer function.
Construct a state monad computation from a function. (The inverse of runState.)
MSFs with a State monadic layer. This module contains functions to work with MSFs that include a State monadic layer. This includes functions to create new MSFs that include an additional layer, and functions to flatten that layer out of the MSF's transformer stack. It is based on the _strict_ state monad Strict, so when combining it with other modules such as mtl's, the strict version has to be included, i.e. Strict instead of State or Lazy.
A state monad parameterized by the type s of the state to carry. The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.
Build an MSF in the State monad from one that takes the state as an extra input. This is the opposite of runStateS.
A state transformer monad parameterized by:
  • s - The state.
  • m - The inner monad.
The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.
Evaluate a state computation with the given initial state and return the final value, discarding the final state.
Evaluate a state computation with the given initial state and return the final value, discarding the final state.
Evaluate a state computation with the given initial state and return the final state, discarding the final value.
Evaluate a state computation with the given initial state and return the final state, discarding the final value.
Map both the return value and final state of a computation using the given function.
Map both the return value and final state of a computation using the given function.
Unwrap a state monad computation as a function. (The inverse of state.)
Build an MSF that takes a state as an extra input from one on the State monad. This is the opposite of stateS.
Build an MSF function that takes a fixed state as additional input, from an MSF in the State monad, and outputs the new state with every transformation step.
Build an MSF function that takes a fixed state as additional input, from an MSF in the State monad.
withState f m executes action m on a state modified by applying f.
withStateT f m executes action m on a state modified by applying f.