Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype ReactIO m a = ReactIO {
- reactivelyIO :: Producer a m ()
- mergeIO :: (MonadBaseControl IO m, Forall (Pure m)) => ReactIO m x -> ReactIO m y -> ReactIO m (Either (x, y) (Either (x, Maybe y) (Maybe x, y)))
- mergeIO' :: (MonadBaseControl IO m, Forall (Pure m)) => Maybe x -> Maybe y -> ReactIO m x -> ReactIO m y -> ReactIO m (Either (x, y) (Either (x, Maybe y) (Maybe x, y)))
Documentation
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.
ReactIO | |
|
mergeIO :: (MonadBaseControl IO m, Forall (Pure m)) => ReactIO m x -> ReactIO m y -> ReactIO m (Either (x, y) (Either (x, Maybe y) (Maybe x, y))) Source #
mergeIO' :: (MonadBaseControl IO m, Forall (Pure m)) => Maybe x -> Maybe y -> ReactIO m x -> ReactIO m y -> ReactIO 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 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