yield-0.0.0.0: YieldT monad transformer
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Monad.Yield.Aggregation

Synopsis

Documentation

data Aggregation m a b Source #

An effectful stream consumer

The type parameter x represents the consumer's internal state.

Constructors

forall x. Aggregation 

Fields

  • begin :: m x

    Produce the initial state

  • step :: x -> a -> m x

    Consume one item from the stream

  • done :: x -> m b

    Produce the final result

Instances

Instances details
Functor m => Functor (Aggregation m a) Source # 
Instance details

Defined in Control.Monad.Yield.Aggregation

Methods

fmap :: (a0 -> b) -> Aggregation m a a0 -> Aggregation m a b #

(<$) :: a0 -> Aggregation m a b -> Aggregation m a a0 #