pipes-fluid-0.3.0.0: Reactively combines Producers so that a value is yielded as soon as possible.

Safe HaskellNone
LanguageHaskell2010

Pipes.Fluid.ReactIO

Synopsis

Documentation

newtype ReactIO m a Source #

The applicative instance of this combines multiple Producers reactively ie, yields a value as soon as either or both of the input producers yields a value. This creates two threads each time this combinator is used. Warning: This means that the monadic effects are run in isolation from each other so if the monad is something like (StateT s IO), then the state will alternate between the two input producers, which is most likely not what you want.

Constructors

ReactIO 

Fields

Instances

Monad m => Functor (ReactIO m) Source # 

Methods

fmap :: (a -> b) -> ReactIO m a -> ReactIO m b #

(<$) :: a -> ReactIO m b -> ReactIO m a #

(MonadBaseControl IO m, Forall * (Pure m)) => Applicative (ReactIO m) Source # 

Methods

pure :: a -> ReactIO m a #

(<*>) :: ReactIO m (a -> b) -> ReactIO m a -> ReactIO m b #

(*>) :: ReactIO m a -> ReactIO m b -> ReactIO m b #

(<*) :: ReactIO m a -> ReactIO m b -> ReactIO m a #

Wrapped (ReactIO m0 a0) Source # 

Associated Types

type Unwrapped (ReactIO m0 a0) :: * #

Methods

_Wrapped' :: Iso' (ReactIO m0 a0) (Unwrapped (ReactIO m0 a0)) #

(~) * (ReactIO m0 a0) t0 => Rewrapped (ReactIO m1 a1) t0 Source # 
type Unwrapped (ReactIO m0 a0) Source # 
type Unwrapped (ReactIO m0 a0) = Producer a0 m0 ()

mergeIO :: (MonadBaseControl IO m, Forall (Pure m)) => ReactIO m x -> ReactIO m y -> ReactIO m (Either (x, y) (Either (x, Maybe y) (Maybe x, y))) Source #

mergeIO' :: (MonadBaseControl IO m, Forall (Pure m)) => Maybe x -> Maybe y -> ReactIO m x -> ReactIO m y -> ReactIO m (Either (x, y) (Either (x, Maybe y) (Maybe x, y))) Source #

Reactively combines two producers, given initial values to use when the produce hasn't produced anything yet Combine two signals, and returns a signal that emits Either bothfired (Either (leftFired, previousRight) (previousLeft, rightFired)). This creates two threads each time this combinator is used. Warning: This means that the monadic effects are run in isolation from each other so if the monad is something like (StateT s IO), then the state will alternate between the two input producers, which is most likely not what you want. This will be detect as a compile error due to use of Control.Concurrent.Async.Lifted.Safe