polysemy-0.1.2.0: Higher-order, low-boilerplate, zero-cost free monads.

Safe HaskellNone
LanguageHaskell2010

Polysemy.Output

Contents

Synopsis

Effect

data Output o m a where Source #

An effect capable of sending messages. Useful for streaming output and for logging.

Constructors

Output :: o -> Output o m () 
Instances
type DefiningModule (Output :: Type -> k -> Type -> Type) Source # 
Instance details

Defined in Polysemy.Output

type DefiningModule (Output :: Type -> k -> Type -> Type) = "Polysemy.Output"

Actions

output :: forall o. forall r. Member (Output o) r => o -> Sem r () Source #

Interpretations

runFoldMapOutput :: forall o m r a. Monoid m => (o -> m) -> Sem (Output o ': r) a -> Sem r (m, a) Source #

Run an Output effect by transforming it into a monoid.

runIgnoringOutput :: Sem (Output o ': r) a -> Sem r a Source #

Run an Output effect by ignoring it.

runBatchOutput :: forall o r a. Int -> Sem (Output [o] ': r) a -> Sem (Output [[o]] ': r) a Source #

Accumulate outputs so they are delayed until they reach at least size size.

If size is 0, this interpretation will not emit anything in the resulting Output effect.

Since: 0.1.2.0