-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | monadic loop dsl. -- -- A simple loop dsl for monadic actions. @package loop-dsl @version 0.1.0.0 module Control.Monad.Loop.Internal data Loop m a [For] :: t a -> Loop m (t a) [While] :: Loop m (t a) -> (a -> Bool) -> Loop m (t a, a -> Bool) -- | for clause to start a loop for :: Traversable t => t a -> Loop m (t a) -- | while clause to determine the terminal condition of a loop. -- --
--   for [(0::Int)..] `while` (<10) `with` \(i::Int) -> lift do
--     putStrLn "hi"
--   
while :: Traversable t => Loop m (t a) -> (a -> Bool) -> Loop m (t a, a -> Bool) evalLoop :: Monad m => Loop m a -> m a -- | start a for-each style loop. with_ :: (Traversable t, Monad m) => Loop m (t a) -> (a -> ExceptT () m ()) -> m () enumerateTrav :: (Traversable t, Integral n) => t a -> t (n, a) -- | start a for-each style loop with access to indices. withi_ :: (Traversable t, Monad m, Integral n) => Loop m (t a) -> ((n, a) -> ExceptT () m ()) -> m () -- | start a for-each style loop with while clause. withWhile_ :: (Traversable t, Monad m) => Loop m (t a, a -> Bool) -> (a -> ExceptT () m ()) -> m () -- | start a for-each style loop with while clause and access to indices. withWhilei_ :: (Traversable t, Monad m, Integral n) => Loop m (t a, a -> Bool) -> ((n, a) -> ExceptT () m ()) -> m () -- | break to the outer loop. quit :: Monad m => ExceptT () m a -- | break to the outer most loop. cease :: Monad m => ExceptT () m a module Control.Monad.Loop -- | for clause to start a loop for :: Traversable t => t a -> Loop m (t a) -- | while clause to determine the terminal condition of a loop. -- --
--   for [(0::Int)..] `while` (<10) `with` \(i::Int) -> lift do
--     putStrLn "hi"
--   
while :: Traversable t => Loop m (t a) -> (a -> Bool) -> Loop m (t a, a -> Bool) class With m ret param with :: With m ret param => Loop m ret -> (param -> ExceptT () m ()) -> m () -- | start a for-each style loop. with_ :: (Traversable t, Monad m) => Loop m (t a) -> (a -> ExceptT () m ()) -> m () -- | start a for-each style loop with access to indices. withi_ :: (Traversable t, Monad m, Integral n) => Loop m (t a) -> ((n, a) -> ExceptT () m ()) -> m () -- | start a for-each style loop with while clause. withWhile_ :: (Traversable t, Monad m) => Loop m (t a, a -> Bool) -> (a -> ExceptT () m ()) -> m () -- | start a for-each style loop with while clause and access to indices. withWhilei_ :: (Traversable t, Monad m, Integral n) => Loop m (t a, a -> Bool) -> ((n, a) -> ExceptT () m ()) -> m () -- | break to the outer loop. quit :: Monad m => ExceptT () m a -- | break to the outer most loop. cease :: Monad m => ExceptT () m a instance (GHC.Base.Monad m, Data.Traversable.Traversable t, GHC.Real.Integral n) => Control.Monad.Loop.With m (t a, a -> GHC.Types.Bool) (n, a) instance (GHC.Base.Monad m, Data.Traversable.Traversable t) => Control.Monad.Loop.With m (t a, a -> GHC.Types.Bool) a instance (GHC.Base.Monad m, Data.Traversable.Traversable t, GHC.Real.Integral n) => Control.Monad.Loop.With m (t a) (n, a) instance (GHC.Base.Monad m, Data.Traversable.Traversable t) => Control.Monad.Loop.With m (t a) a