jwiegley/monad-extras — pull request #2 by soapie (2013-11-07 23:40:27+00:00)
Title: Add sequenceWhile

Unlike `sequenceUntil`, `sequenceWhile` discards the final value.

I got the names/definitions from [this thread](http://www.haskell.org/pipermail/libraries/2009-May/011599.html) -- changing `sequenceWhile` to discard the last value to keep its behaviour more in line with `takeWhile`.

I don't know whether it's worth having both functions though. My suspicion is that `sequenceUntil` is more useful (if your sequence of actions is just `repeat m` you can make the uninteresting value(s) `Nothing` and use `unfoldM`/`whileJust` in `monad-loops` but I think it's more awkward if you want to keep the final value.)