monad-resumption-0.1.0.1: Resumption and reactive resumption monads for Haskell.

Safe HaskellSafe-Inferred

Control.Monad.Resumption.Reactive

Description

A reactive resumption monad transforemer, based on the formulation in the article Cheap (But Functional) Threads by William L. Harrison and Adam Procter.

Synopsis

Documentation

newtype ReacT input output m a Source

Reactive resumption monad transformer.

Constructors

ReacT 

Fields

deReacT :: m (Either a (output, input -> ReacT input output m a))
 

Instances

MonadTrans (ReacT input output) 
Monad m => Monad (ReacT input output m) 
Monad m => Functor (ReacT input output m) 
Monad m => Applicative (ReacT input output m) 
MonadIO m => MonadIO (ReacT input output m) 

signal :: Monad m => output -> ReacT input output m inputSource

Outputs its argument, then waits for the next input and returns it.

(<~>) :: Monad m => ReacT i o m a -> ReacT o i m b -> ResT m (Either a b)Source

Tennis operator.