polymorphic type in state of state monad