Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Loop m a where
- for :: Traversable t => t a -> Loop m (t a)
- while :: Traversable t => Loop m (t a) -> (a -> Bool) -> Loop m (t a, a -> Bool)
- evalLoop :: Monad m => Loop m a -> m a
- with_ :: (Traversable t, Monad m) => Loop m (t a) -> (a -> ExceptT () m ()) -> m ()
- enumerateTrav :: (Traversable t, Integral n) => t a -> t (n, a)
- withi_ :: (Traversable t, Monad m, Integral n) => Loop m (t a) -> ((n, a) -> ExceptT () m ()) -> m ()
- withWhile_ :: (Traversable t, Monad m) => Loop m (t a, a -> Bool) -> (a -> ExceptT () m ()) -> m ()
- withWhilei_ :: (Traversable t, Monad m, Integral n) => Loop m (t a, a -> Bool) -> ((n, a) -> ExceptT () m ()) -> m ()
- quit :: Monad m => ExceptT () m a
- cease :: Monad m => ExceptT () m a
Documentation
while :: Traversable t => Loop m (t a) -> (a -> Bool) -> Loop m (t a, a -> Bool) Source #
while
clause to determine the terminal condition of a loop.
for [(0::Int)..] `while` (<10) `with` \(i::Int) -> lift do putStrLn "hi"
with_ :: (Traversable t, Monad m) => Loop m (t a) -> (a -> ExceptT () m ()) -> m () Source #
start a for-each style loop.
enumerateTrav :: (Traversable t, Integral n) => t a -> t (n, a) Source #
withi_ :: (Traversable t, Monad m, Integral n) => Loop m (t a) -> ((n, a) -> ExceptT () m ()) -> m () Source #
start a for-each style loop with access to indices.
withWhile_ :: (Traversable t, Monad m) => Loop m (t a, a -> Bool) -> (a -> ExceptT () m ()) -> m () Source #
start a for-each style loop with while clause.
withWhilei_ :: (Traversable t, Monad m, Integral n) => Loop m (t a, a -> Bool) -> ((n, a) -> ExceptT () m ()) -> m () Source #
start a for-each style loop with while clause and access to indices.