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

Safe HaskellNone
LanguageHaskell2010

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 

Fields

Instances

Monad m => Functor (ImpulseIO m) Source # 

Methods

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

Methods

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

Methods

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

Methods

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

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