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

Pipes.Fluid.ImpulseIO

Synopsis

# Documentation

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

 ImpulseIO FieldsimpulsivelyIO :: Producer a m ()

Instances

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