boombox-0.0: Chronokinetic stream sources and incremental consumers

Safe HaskellSafe
LanguageHaskell2010

Data.Boombox.Player

Synopsis

Documentation

data Drive w s m a Source

Constructors

Done a 
Partial (s -> Drive w s m a) 
Leftover s (Drive w s m a) 
Eff (m (Drive w s m a)) 
Cont (forall r. w (Drive w s m a -> r) -> r) 

newtype PlayerT w s m a Source

Player w s m a is a monadic consumer of a stream of s. Player may send a control signal parameterized by w; the control surface of the producer (usually Tape) should match it.

Constructors

PlayerT 

Fields

unPlayerT :: forall r. (a -> Drive w s m r) -> Drive w s m r
 

Instances

runPlayerT :: PlayerT w s m a -> Drive w s m a Source

control :: (forall a. w a -> (a, b)) -> PlayerT w s m b Source

Send a control signal.

await :: PlayerT w s m s Source

Consume a value.

leftover :: s -> PlayerT w s m () Source

Push a leftover back.

leftovers :: Foldable f => f s -> PlayerT w s m () Source

Put some leftovers.

lookAhead :: (Functor w, Functor m) => PlayerT w s m a -> PlayerT w s m a Source

Run a PlayerT action without consuming any input.