shared-state monadic combinators