StateT -package:gi-atk

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.
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.
A state transformer monad parameterized by:
  • g - A representable functor used to memoize results for a state Rep g
  • 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.
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.
State Transformer
A state transformer monad parameterized by the state and inner monad. The implementation is copied from the transformers package with the return tuple swapped.
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.
Widget states
The state that the plugin provider wants to transition to.
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.
Run an State effect in terms of operations in IO. Internally, this simply creates a new IORef, passes it to runStateIORef, and then returns the result and the final value of the IORef. Note: This is not safe in a concurrent setting, as modify isn't atomic. If you need operations over the state to be atomic, use atomicStateToIO instead. Beware: As this uses an IORef internally, all other effects will have local state semantics in regards to State effects interpreted this way. For example, throw and catch will never revert puts, even if runError is used after stateToIO.
Run an State effect in terms of operations in ST. Internally, this simply creates a new STRef, passes it to runStateSTRef, and then returns the result and the final value of the STRef. Beware: As this uses an STRef internally, all other effects will have local state semantics in regards to State effects interpreted this way. For example, throw and catch will never revert puts, even if runError is used after stateToST. When not using the plugin, one must introduce the existential st type to stateToST, so that the resulting type after runM can be resolved into forall st. ST st (s, a) for use with runST. Doing so requires -XScopedTypeVariables.
stResult :: forall s a. (s, a)
stResult = runST ( (runM $ stateToST @_ @st undefined $ pure undefined) :: forall st. ST st (s, a) )
Modify the part of the TCState focused on by the lens, and return some result.