Use Control.Monad.IfElse's whenM, rather than NIH