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

Safe HaskellNone
LanguageHaskell2010

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 

Fields

Instances

Monad m => Functor (Impulse m) Source # 

Methods

fmap :: (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.

Methods

pure :: 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.

Methods

merge' :: 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 # 

Methods

mempty :: 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 Types

type 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 ()