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.

  1. concatMapM :: Monad m => (a -> m (Stream m b)) -> Stream m a -> Stream m b

    streamly-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.

  2. concatMapM :: Monad m => (a -> m (Stream m b)) -> Stream m a -> Stream m b

    streamly-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.

  3. rollingMap :: forall (m :: Type -> Type) a b . Monad m => (Maybe a -> a -> b) -> Stream m a -> Stream m b

    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

  4. rollingMap2 :: forall (m :: Type -> Type) a b . Monad m => (a -> a -> b) -> Stream m a -> Stream m b

    streamly-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

  5. rollingMapM :: Monad m => (Maybe a -> a -> m b) -> Stream m a -> Stream m b

    streamly-core Streamly.Internal.Data.Stream

    Like rollingMap but with an effectful map function. Pre-release

  6. concatMap :: forall a (m :: Type -> Type) b . (a -> StreamK m b) -> StreamK m a -> StreamK m b

    streamly-core Streamly.Internal.Data.StreamK

    No documentation available.

  7. concatMapEffect :: Monad m => (b -> StreamK m a) -> m b -> StreamK m a

    streamly-core Streamly.Internal.Data.StreamK

    No documentation available.

  8. concatMapWith :: forall (m :: Type -> Type) b a . (StreamK m b -> StreamK m b -> StreamK m b) -> (a -> StreamK m b) -> StreamK m a -> StreamK m b

    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.

  9. mergeMapWith :: forall (m :: Type -> Type) b a . (StreamK m b -> StreamK m b -> StreamK m b) -> (a -> StreamK m b) -> StreamK m a -> StreamK m b

    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

  10. concatMap :: forall (m :: Type -> Type) b a c . Monad m => (b -> Unfold m a c) -> Unfold m a b -> Unfold m a c

    streamly-core Streamly.Internal.Data.Unfold

    No documentation available.

Page 1091 of many | Previous | Next