state package:rebase
Embed a simple state action into the monad.
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.
Like
modifyTVar' but the function is a simple state transition
that can return a side value which is passed on as the result of the
STM.
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.
Describes the behaviour of a thread when an asynchronous exception is
received.
Minimal definition is either both of get and put or
just 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 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.)
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.