Hoogle Search

Within LTS Haskell 24.45 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. foldMany :: forall (m :: Type -> Type) a b . Monad m => Fold m a b -> Stream m a -> Stream m b

    streamly-core Streamly.Data.Stream

    Apply a Fold repeatedly on a stream and emit the results in the output stream. Definition:

    >>> foldMany f = Stream.parseMany (Parser.fromFold f)
    
    Example, empty stream:
    >>> f = Fold.take 2 Fold.sum
    
    >>> fmany = Stream.fold Fold.toList . Stream.foldMany f
    
    >>> fmany $ Stream.fromList []
    []
    
    Example, last fold empty:
    >>> fmany $ Stream.fromList [1..4]
    [3,7]
    
    Example, last fold non-empty:
    >>> fmany $ Stream.fromList [1..5]
    [3,7,5]
    
    Note that using a closed fold e.g. Fold.take 0, would result in an infinite stream on a non-empty input stream.

  2. parseMany :: forall (m :: Type -> Type) a b . Monad m => Parser a m b -> Stream m a -> Stream m (Either ParseError b)

    streamly-core Streamly.Data.Stream

    Apply a Parser repeatedly on a stream and emit the parsed values in the output stream. Example:

    >>> s = Stream.fromList [1..10]
    
    >>> parser = Parser.takeBetween 0 2 Fold.sum
    
    >>> Stream.fold Fold.toList $ Stream.parseMany parser s
    [Right 3,Right 7,Right 11,Right 15,Right 19]
    
    This is the streaming equivalent of the many parse combinator. Known Issues: When the parser fails there is no way to get the remaining stream.

  3. unfoldMany :: forall (m :: Type -> Type) a b . Monad m => Unfold m a b -> Stream m a -> Stream m b

    streamly-core Streamly.Data.Stream

    unfoldMany unfold stream uses unfold to map the input stream elements to streams and then flattens the generated streams into a single output stream. Like concatMap but uses an Unfold for stream generation. Unlike concatMap this can fuse the Unfold code with the inner loop and therefore provide many times better performance.

  4. many :: forall (m :: Type -> Type) b c a . Monad m => Unfold m b c -> Unfold m a b -> Unfold m a c

    streamly-core Streamly.Data.Unfold

    Apply the first unfold to each output element of the second unfold and flatten the output in a single stream.

    >>> many u = Unfold.many2 (Unfold.lmap snd u)
    

  5. runArrayFoldMany :: forall (m :: Type -> Type) a b . (Monad m, Unbox a) => ChunkFold m a b -> StreamK m (Array a) -> StreamK m (Either ParseError b)

    streamly-core Streamly.Internal.Data.Array.Stream

    Apply an ChunkFold repeatedly on an array stream and emit the fold outputs in the output stream. See "Streamly.Data.Stream.foldMany" for more details. Pre-release

  6. data ManyState s1 s2

    streamly-core Streamly.Internal.Data.Fold

    No documentation available.

  7. many :: forall (m :: Type -> Type) a b c . Monad m => Fold m a b -> Fold m b c -> Fold m a c

    streamly-core Streamly.Internal.Data.Fold

    Collect zero or more applications of a fold. many first second applies the first fold repeatedly on the input stream and accumulates it's results using the second fold.

    >>> two = Fold.take 2 Fold.toList
    
    >>> twos = Fold.many two Fold.toList
    
    >>> Stream.fold twos $ Stream.fromList [1..10]
    [[1,2],[3,4],[5,6],[7,8],[9,10]]
    
    Stops when second fold stops. See also: concatMap, foldMany

  8. manyPost :: forall (m :: Type -> Type) a b c . Monad m => Fold m a b -> Fold m b c -> Fold m a c

    streamly-core Streamly.Internal.Data.Fold

    Like many, but the "first" fold emits an output at the end even if no input is received. Internal See also: concatMap, foldMany

  9. refoldMany :: forall (m :: Type -> Type) a b x c . Monad m => Fold m a b -> Refold m x b c -> Refold m x a c

    streamly-core Streamly.Internal.Data.Fold

    Like many but uses a Refold for collecting.

  10. refoldMany1 :: forall (m :: Type -> Type) x a b c . Monad m => Refold m x a b -> Fold m b c -> Refold m x a c

    streamly-core Streamly.Internal.Data.Fold

    Like many but uses a Refold for splitting. Internal

Page 206 of many | Previous | Next