State monad for Definitions