bluefin-0.0.9.0: The Bluefin effect system
Safe HaskellSafe-Inferred
LanguageHaskell2010

Bluefin.Consume

Synopsis

Documentation

Consume allows you to await values during the execution of a Bluefin operation. It provides similar functionality to await from Conduit or Pipes.

Handle

type Consume a = Coroutine () a #

Handlers

consumeEach #

Arguments

:: forall b (es :: Effects) r. (forall (e :: Effects). Consume b e -> Eff (e :& es) r)

Body

-> Eff es b

Value to send to each await in the body.

-> Eff es r 

A version of forEach specialized to Consume. Every time the Consume is used to await a b, feed it the one created by the handler.

consumeStream #

Arguments

:: forall a (es :: Effects) r. (forall (e :: Effects). Consume a e -> Eff (e :& es) r)

Each await from the Consume ...

-> (forall (e :: Effects). Stream a e -> Eff (e :& es) r)

... receives the value yielded from the Stream

-> Eff es r 

Effectful operations

await :: forall (e :: Effects) (es :: Effects) a. e :> es => Consume a e -> Eff es a #