Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type Producer action item = Vendor (Const Void) (Next item) action
- type ProducerPlus up action item = Vendor up (Next item) action
- empty :: forall up item action. ProducerPlus up action item
- singleton :: forall up item action. Job up action item -> ProducerPlus up action item
- effect :: forall up action item. action item -> ProducerPlus up action item
- each :: forall up foldable item action. Foldable foldable => foldable item -> ProducerPlus up action item
- append :: forall up item action. ProducerPlus up action item -> ProducerPlus up action item -> ProducerPlus up action item
- unfoldPure :: forall state up item action. (state -> Step (item, state)) -> state -> ProducerPlus up action item
- unfoldEffect :: forall state up item action. (state -> action (Step (item, state))) -> state -> ProducerPlus up action item
- unfoldJob :: forall state up item action. (state -> Job up action (Step (item, state))) -> state -> ProducerPlus up action item
- null :: forall action item. Monad action => StateT (Producer action item) action Bool
- head :: forall action item. Monad action => StateT (Producer action item) action (Step item)
- pop :: forall action item. Monad action => StateT (Producer action item) action (Step item)
- push :: forall up action item. Monad action => item -> StateT (ProducerPlus up action item) action ()
Types
type ProducerPlus up action item = Vendor up (Next item) action Source #
Examples
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 :: 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
unfoldPure :: forall state up item action. (state -> 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 #
unfoldJob :: forall state up item action. (state -> Job up action (Step (item, state))) -> state -> ProducerPlus up action item Source #
State actions
null :: forall action item. Monad action => StateT (Producer action item) action Bool Source #
Test whether the state is an empty stream
head :: forall action item. Monad action => StateT (Producer action item) action (Step item) Source #
Peek at the first item in the stream state