Use Control.Monad.Loops's whileM, rather than NIH