runState -package:effectful-core package:monadology

Unwrap a state monad computation as a function. (The inverse of state.)
Run a state monad over this reference.
Dangerous, because the MVar won't be released on exception.
Run the StateT on an MVar, taking the initial state and putting the final state.