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

Safe HaskellNone
LanguageHaskell2010

Pipes.Fluid.React

Synopsis

Documentation

newtype React 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.

Constructors

React 

Fields

Instances

Monad m => Functor (React m) Source # 

Methods

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

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

(Alternative m, Monad m) => Applicative (React m) Source #

Reactively combines two producers, given initial values to use when the producer is blocked/failed. This only works for Alternative m where failure means there was no effects, eg. STM, or MonadTrans t => t STM. Be careful of monad transformers like ExceptT that hides the STM Alternative instance.

Methods

pure :: a -> React m a #

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

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

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

Wrapped (React m0 a0) Source # 

Associated Types

type Unwrapped (React m0 a0) :: * #

Methods

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

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

merge :: (Alternative m, Monad m) => React m x -> React m y -> React m (Either (x, y) (Either (x, Maybe y) (Maybe x, y))) Source #

A simpler version of merge', with the initial values as Nothing

merge' :: (Alternative m, Monad m) => Maybe x -> Maybe y -> React m x -> React m y -> React 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 only works for Alternative m where failure means there was no effects, eg. STM, or MonadTrans t => t STM. Be careful of monad transformers ExceptT that hides the STM Alternative instance.