compose state with monad