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

Pipes.Fluid.Impulse

Synopsis

# Documentation

newtype Impulse 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

 Impulse Fieldsimpulsively :: Producer a m ()

Instances

 Monad m => Functor (Impulse m) Source # Methodsfmap :: (a -> b) -> Impulse m a -> Impulse m b #(<\$) :: a -> Impulse m b -> Impulse m a # (Alternative m, Monad m) => Applicative (Impulse m) Source # Impulseively 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. Methodspure :: a -> Impulse m a #(<*>) :: Impulse m (a -> b) -> Impulse m a -> Impulse m b #liftA2 :: (a -> b -> c) -> Impulse m a -> Impulse m b -> Impulse m c #(*>) :: Impulse m a -> Impulse m b -> Impulse m b #(<*) :: Impulse m a -> Impulse m b -> Impulse m a # (Alternative m, Monad m) => Merge (Impulse m) Source # Impulseively 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. Methodsmerge' :: Maybe x -> Maybe y -> Impulse m x -> Impulse m y -> Impulse m (Merged x y) Source # (Alternative m, Monad m, Semigroup a) => Semigroup (Impulse m a) Source # Methods(<>) :: Impulse m a -> Impulse m a -> Impulse m a #sconcat :: NonEmpty (Impulse m a) -> Impulse m a #stimes :: Integral b => b -> Impulse m a -> Impulse m a # (Alternative m, Monad m, Semigroup a) => Monoid (Impulse m a) Source # Methodsmempty :: Impulse m a #mappend :: Impulse m a -> Impulse m a -> Impulse m a #mconcat :: [Impulse m a] -> Impulse m a # Wrapped (Impulse m a) Source # Associated Typestype Unwrapped (Impulse m a) :: * # Methods_Wrapped' :: Iso' (Impulse m a) (Unwrapped (Impulse m a)) # (~) * (Impulse m1 a1) t => Rewrapped (Impulse m2 a2) t Source # type Unwrapped (Impulse m a) Source # type Unwrapped (Impulse m a) = Producer a m ()