Hoogle Search
Within LTS Haskell 24.68 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
concatMapM :: Monad m => (a -> m (Stream m b)) -> Stream m a -> Stream m bstreamly-core Streamly.Internal.Data.Stream 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. See unfoldMany for a fusible alternative.
concatMapM :: Monad m => (a -> m (Stream m b)) -> Stream m a -> Stream m bstreamly-core Streamly.Internal.Data.Stream 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. See unfoldMany for a fusible alternative.
-
streamly-core Streamly.Internal.Data.Stream Apply a function on every two successive elements of a stream. The first argument of the map function is the previous element and the second argument is the current element. When the current element is the first element, the previous element is Nothing. Pre-release
rollingMap2 :: forall (m :: Type -> Type) a b . Monad m => (a -> a -> b) -> Stream m a -> Stream m bstreamly-core Streamly.Internal.Data.Stream Like rollingMap but requires at least two elements in the stream, returns an empty stream otherwise. This is the stream equivalent of the list idiom zipWith f xs (tail xs). Pre-release
rollingMapM :: Monad m => (Maybe a -> a -> m b) -> Stream m a -> Stream m bstreamly-core Streamly.Internal.Data.Stream Like rollingMap but with an effectful map function. Pre-release
concatMap :: forall a (m :: Type -> Type) b . (a -> StreamK m b) -> StreamK m a -> StreamK m bstreamly-core Streamly.Internal.Data.StreamK No documentation available.
concatMapEffect :: Monad m => (b -> StreamK m a) -> m b -> StreamK m astreamly-core Streamly.Internal.Data.StreamK No documentation available.
-
streamly-core Streamly.Internal.Data.StreamK Perform a concatMap using a specified concat strategy. The first argument specifies a merge or concat function that is used to merge the streams generated by the map function.
-
streamly-core Streamly.Internal.Data.StreamK Combine streams in pairs using a binary combinator, the resulting streams are then combined again in pairs recursively until we get to a single combined stream. The composition would thus form a binary tree. For example, you can sort a stream using merge sort like this:
>>> s = StreamK.fromStream $ Stream.fromList [5,1,7,9,2] >>> generate = StreamK.fromPure >>> combine = StreamK.mergeBy compare >>> Stream.fold Fold.toList $ StreamK.toStream $ StreamK.mergeMapWith combine generate s [1,2,5,7,9]
Note that if the stream length is not a power of 2, the binary tree composed by mergeMapWith would not be balanced, which may or may not be important depending on what you are trying to achieve. Caution: the stream of streams must be finite Pre-release -
streamly-core Streamly.Internal.Data.Unfold No documentation available.