A monad for managed values