supply-next-0.0.1.2: Supply-chain interface for basic streaming
Safe HaskellSafe-Inferred
LanguageGHC2021

Next.Producer.Examples

Synopsis

Trivialities

empty :: forall up item action. ProducerPlus up action item Source #

The empty stream

singleton :: forall up item action. Job up action item -> ProducerPlus up action item Source #

Yields one item, then stops

effect :: forall up action item. action item -> ProducerPlus up action item Source #

A single item obtained by performing an effect

each :: forall up foldable item action. Foldable foldable => foldable item -> ProducerPlus up action item Source #

Yields all the items from the given list

Append

append :: forall up item action. ProducerPlus up action item -> ProducerPlus up action item -> ProducerPlus up action item Source #

Yields all the items of the first stream, followed by all the items of the second

Unfold

unfoldJob :: forall state up item action. (state -> Job up action (Step (item, state))) -> state -> ProducerPlus up action item Source #

unfoldEffect :: forall state up item action. (state -> action (Step (item, state))) -> state -> ProducerPlus up action item Source #

unfoldPure :: forall state up item action. (state -> Step (item, state)) -> state -> ProducerPlus up action item Source #