Utilities for the Haskell StateVar package