Safe Haskell | Safe-Inferred |
---|
This is for trying out loop alternatives.
Names and types are subjects to change.
Documentation
loop :: (Enum e, Eq e, Monad m) => e -> e -> (e -> m ()) -> m ()Source
loop start end f
: Loops from start
to end
(inclusive), executing f
on each iteration. Same as forM_ [start..end] f
.
Uses succ
inside, which does a bounds (overflow) check.
unsafeLoop :: (Enum e, Eq e, Monad m) => e -> e -> (e -> m ()) -> m ()Source