Hoogle Search
Within LTS Haskell 24.19 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
concatMapM :: (IsStream t, Monad m) => (a -> m (t m b)) -> t m a -> t m bstreamly Streamly.Internal.Data.Stream.IsStream Map a stream producing monadic function on each element of the stream and then flatten the results into a single stream. Since the stream generation function is monadic, unlike concatMap, it can produce an effect at the beginning of each iteration of the inner loop.
concatMapM :: (IsStream t, Monad m) => (a -> m (t m b)) -> t m a -> t m bstreamly Streamly.Internal.Data.Stream.IsStream Map a stream producing monadic function on each element of the stream and then flatten the results into a single stream. Since the stream generation function is monadic, unlike concatMap, it can produce an effect at the beginning of each iteration of the inner loop.
-
streamly Streamly.Internal.Data.Stream.IsStream Like concatMapWith but carries a state which can be used to share information across multiple steps of concat.
concatSmapMWith combine f initial = concatMapWith combine id . smapM f initial
Pre-release -
streamly Streamly.Internal.Data.Stream.IsStream Like iterateMap but carries a state in the stream generation function. This can be used to traverse graph like structures, we can remember the visited nodes in the state to avoid cycles. Note that a combination of iterateMap and usingState can also be used to traverse graphs. However, this function provides a more localized state instead of using a global state. See also: mfix Pre-release
rollingMapM :: (IsStream t, Monad m) => (Maybe a -> a -> m b) -> t m a -> t m bstreamly Streamly.Internal.Data.Stream.IsStream Like rollingMap but with an effectful map function. Pre-release
smapM :: (IsStream t, Monad m) => (s -> a -> m (s, b)) -> m s -> t m a -> t m bstreamly Streamly.Internal.Data.Stream.IsStream A stateful mapM, equivalent to a left scan, more like mapAccumL. Hopefully, this is a better alternative to scan. Separation of state from the output makes it easier to think in terms of a shared state, and also makes it easier to keep the state fully strict and the output lazy. See also: scanlM' Pre-release
smapM :: (IsStream t, Monad m) => (s -> a -> m (s, b)) -> m s -> t m a -> t m bstreamly Streamly.Internal.Data.Stream.IsStream A stateful mapM, equivalent to a left scan, more like mapAccumL. Hopefully, this is a better alternative to scan. Separation of state from the output makes it easier to think in terms of a shared state, and also makes it easier to keep the state fully strict and the output lazy. See also: scanlM' Pre-release
parMapM :: MonadAsync m => (Config -> Config) -> (a -> m b) -> Stream m a -> Stream m bstreamly Streamly.Internal.Data.Stream.Prelude Definition:
>>> parMapM modifier f = Stream.parConcatMap modifier (Stream.fromEffect . f)
For example, the following finishes in 3 seconds (as opposed to 6 seconds) because all actions run in parallel. Even though results are available out of order they are ordered due to the config option:>>> f x = delay x >> return x >>> Stream.fold Fold.toList $ Stream.parMapM (Stream.ordered True) f $ Stream.fromList [3,2,1] 1 sec 2 sec 3 sec [3,2,1]
concatMapM :: (IsStream t, Monad m) => (a -> m (t m b)) -> t m a -> t m bstreamly Streamly.Prelude Map a stream producing monadic function on each element of the stream and then flatten the results into a single stream. Since the stream generation function is monadic, unlike concatMap, it can produce an effect at the beginning of each iteration of the inner loop.
sPMapMV :: Stream -> MVar PlayMaptidal Sound.Tidal.Boot No documentation available.