loop package:distribution-opensuse

A looping operation, where the predicate returns Left as a seed for the next loop or Right to abort the loop.
loop (\x -> if x < 10 then Left $ x * 2 else Right $ show x) 1 == "16"
A monadic version of loop, where the predicate returns Left as a seed for the next loop or Right to abort the loop.