A monad for weighted nondeterminism