apply StateMonad