module Control.Monad.Loop
( LoopT(..), Loop, loop
, cons, continue, continue_, break_, exec_
, ForEach(ForEachValue, ForEachIx)
, iterate, forever, for, unfoldl, while
, forEach, iforEach
) where
import Control.Monad.Loop.Unroll
( LoopT(..), Loop, loop
, cons, continue, continue_, break_, exec_
, ForEach(ForEachValue, ForEachIx)
, noUnroll
)
import qualified Control.Monad.Loop.Unroll as U
import Prelude hiding (iterate)
iterate
:: a
-> (a -> a)
-> LoopT m a
iterate = U.iterate noUnroll
forever :: LoopT m ()
forever = U.forever noUnroll
for
:: a
-> (a -> Bool)
-> (a -> a)
-> LoopT m a
for = U.for noUnroll
unfoldl
:: (i -> Maybe (i, a))
-> i
-> LoopT m a
unfoldl = U.unfoldl noUnroll
while
:: Monad m
=> m Bool
-> LoopT m ()
while = U.while noUnroll
forEach :: ForEach m c => c -> m (ForEachValue c)
forEach = U.forEach noUnroll
iforEach :: ForEach m c => c -> m (ForEachIx c, ForEachValue c)
iforEach = U.iforEach noUnroll