Iterates an IO
action. Starting with an initial state, the action is applied repeatedly until it
returns a final value in Sum.inr
. Each time it returns Sum.inl
, the returned value is treated as
a new sate.
Normally, programs written in IO
use the same control structures as those written in other monads.
There is one specific IO
helper.