State
Types
Type Classes
Methods
getS :: m s
putS :: s -> m ()
stateS :: (s -> (a, s)) -> m a
Class for monads with state.
Functions
Map both the return value and state.
Transform the state.
Run and return only the result.
Run and return only the final state.
Map the inner computation.
Transform the state.
O(1). Retrieve the current state.
O(1). Replace the state with a new value.
O(1). Modify the state by applying a function.
O(1). Strictly modify the state.
O(1). Retrieve a function of the current state.
O(1). Embed a state action into the monad.