garden
Safe HaskellSafe-Inferred
LanguageHaskell2010

Tubes

Synopsis

A series of tubes

Construction and evaluation

type Series i o t a r = CPS r (Tube i o r t) a Source #

A Series of Tubes is the (delimited) continuation embedding into some base type t :: * -> *. Series may be connected into, well, a series via the (><) operator. When the series finishes evaluating it will result in a value of type r.

deliver :: Monad t => Series i o t r r -> t r Source #

"...deliver[s] vast amounts of information" from a Series of tubes. :)

yield :: o -> Series i o t () r Source #

Yield a value downstream in the Series.

await :: Series i o t i r Source #

Blocking-wait for an upstream value from the Series.

finish :: Monad t => Series i o t () () Source #

A Series which does nothing.

impact :: Monad t => t a -> Series i o t a () Source #

Embeds a value with side effects into an appropriate Series.

Combination

(><) :: forall i e a o t. Monad t => Series i e t () () -> Series e o t () () -> Series i o t a () Source #

Constructs a Series of Tubes.

Utility

newtype Tube i o r t a Source #

An intermediate link in the series of tubes.

Constructors

Tube 

Fields

Instances

Instances details
Functor (Tube i o r t) Source # 
Instance details

Defined in Tubes

Methods

fmap :: (a -> b) -> Tube i o r t a -> Tube i o r t b Source #

(<$) :: a -> Tube i o r t b -> Tube i o r t a Source #

newtype Source i t r Source #

The head of a stream processing series.

Constructors

Source 

Fields

newtype Sink o t r Source #

The reservoir at the end of a stream processing pipeline.

Constructors

Sink 

Fields

pause :: (() -> Tube i o r t a) -> Source i t r -> Source o t r Source #

A covariant mapping of a 'Source i t r' into 'Source o t r'.

suspend :: (i -> Tube i o r t a) -> Sink o t r -> Sink i t r Source #

A contravariant mapping of a 'Sink o t r' into a 'Sink i t r'.