boombox-0.0: Chronokinetic stream sources and incremental consumers

Safe HaskellSafe
LanguageHaskell2010

Data.Boombox.Boombox

Synopsis

Documentation

(@.$) :: (Comonad w, Monad m) => Tape w m s -> PlayerT w s m a -> m a infix 6 Source

Feed a tape to a player and extract the final result.

(@-$) :: (Comonad w, Monad m) => Tape w m s -> PlayerT w s m a -> m ([s], Tape w m s, a) infix 6 Source

Feed a tape to a player. It returns the leftover input, the remainder of the tape, and the result from the player.

type Boombox v w m a = Tape w (PlayerT v a m) Source

Boombox v w m a b is a transducer from a to b with monadic effect m, a comonadic control v (outgoing) and w (incoming).

(@->) :: (Comonad v, Functor w, Monad m) => Tape v m a -> Boombox v w m a b -> Tape w m b infixl 7 Source

Combine a tape with a boombox. The result will be synchronized with the boombox.

(>->) :: (Comonad u, Comonad v, Functor w, Monad m) => Boombox u v m a b -> Boombox v w m b c -> Boombox u w m a c infixl 8 Source

Connect two boomboxes.

(>-$) :: (Comonad w, Monad m) => Boombox v w m a b -> PlayerT w b m r -> PlayerT v a m r infixr 7 Source

Connect a boombox to a player.

composeWith :: (Comonad v, Functor w, Monad m, Functor n) => (forall x. n x -> m x) -> Tape v m a -> Boombox v w n a b -> Tape w m b Source

connectDrive :: (Comonad w, Monad m) => (forall x. n x -> m x) -> ([s] -> Tape w m s -> a -> m r) -> [s] -> Tape w m s -> Drive w s n a -> m r Source