runState -package:ghc-lib-parser -package:fused-effects 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.