#2309: containers: specialize functions that fail in a Monad to Maybe