runState -package:linear-base package:arrows

Encapsulation of a state-using computation, exposing the initial and final states. Typical usage in arrow notation:
proc p -> do
...
(result, final_state) <- (|runState cmd|) init_state