HaskellWorks.Control.Monad.Lazy

hw-prim-0.6.3.2: Primitive functions and data types

Safe Haskell | None
Language | Haskell2010

HaskellWorks.Control.Monad.Lazy

Synopsis

- interleaveSequenceIO :: [IO a] -> IO [a]
- interleaveSequenceM :: MonadUnliftIO m => [m a] -> m [a]
- interleaveUnfoldrM :: MonadUnliftIO m => (b -> m (Maybe (a, b))) -> b -> m [a]
- interleaveTraverseM :: MonadUnliftIO m => (a -> m b) -> [a] -> m [b]
- interleaveForM :: MonadUnliftIO m => [a] -> (a -> m b) -> m [b]
- forceM :: (Monad m, NFData a) => m a -> m a

# Documentation

interleaveSequenceIO :: [IO a] -> IO [a] #

interleaveSequenceM :: MonadUnliftIO m => [m a] -> m [a] #

interleaveUnfoldrM :: MonadUnliftIO m => (b -> m (Maybe (a, b))) -> b -> m [a] #

Generates a lazy list of values that are produced by a given monadic function.

This function is intended to be like the "standard" `unfoldrM` except that the list is generated lazily.

interleaveTraverseM :: MonadUnliftIO m => (a -> m b) -> [a] -> m [b] #

Traverses the function over the list and produces a lazy list in a monadic context.

It is intended to be like the "standard" `traverse` except that the list is generated lazily.

interleaveForM :: MonadUnliftIO m => [a] -> (a -> m b) -> m [b] #

forceM :: (Monad m, NFData a) => m a -> m a #