Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type Consumer action item product = Job (Next item) action product
- type ConsumerPlus up action item product = TerminableStream item up => Job up action product
- foldPure :: Fold item product -> ConsumerPlus up action item product
- foldEffect :: EffectfulFold action item product -> ConsumerPlus up action item product
- foldJob :: forall item product action up. EffectfulFold (Job up action) item product -> ConsumerPlus up action item product
- toList :: forall up action item. ConsumerPlus up action item [item]
- run :: forall up action item. ConsumerPlus up action item ()
Types
type ConsumerPlus up action item product = TerminableStream item up => Job up action product Source #
Like Consumer
, but with a more general upstream interface
which can be anything in the TerminableStream
class
This type is like Consumer
except that it has an extra type parameter
representing the upstream interface, hence its name is "consumer plus".
Examples
foldPure :: Fold item product -> ConsumerPlus up action item product Source #
Run the stream completely, collecting results using a pure fold
See Fold.Pure
foldEffect :: EffectfulFold action item product -> ConsumerPlus up action item product Source #
Run the stream completely, collecting results using an effectful fold
See Fold.Effectful
foldJob :: forall item product action up. EffectfulFold (Job up action) item product -> ConsumerPlus up action item product Source #
Run the stream completely, collecting results using a
fold that operates in the Job
context
See Fold.Effectful
toList :: forall up action item. ConsumerPlus up action item [item] Source #
Consumes all items and returns them as a list
run :: forall up action item. ConsumerPlus up action item () Source #
Like toList
, but discards the results