15Sep/092
Haskell While Loop
In the past week, while working on three completely unrelated Haskell projects, I have found myself in need of a while loop. So I came up with this one:
Hoogle shows no functions with that type signature, and I couldn't find anything in the documentation that seemed to fit the bill. This seems like a rather fundamental function for getting stuff done, is there something I'm missing?
EDIT: The most code-golfed version I have yet come up with is while p a = p >>= flip when (a >> while p a) can anyone improve on that?












