Safe Haskell  Safe 

Language  Haskell2010 
 data Source
 data OtherStatus
 data Merged a b
 = Coupled Source a b
  LeftOnly OtherStatus a
  RightOnly OtherStatus b
 isBothLive :: Merged x y > Bool
 isLeftLive :: Merged x y > Bool
 isRightLive :: Merged x y > Bool
 isRightDead :: Merged x y > Bool
 isLeftDead :: Merged x y > Bool
 class Merge f where
 merge :: Merge f => f x > f y > f (Merged x y)
 discreteLeft :: Merged x y > Maybe x
 discreteRight :: Merged x y > Maybe y
 discreteBoth :: Merged x y > Maybe (x, y)
 discrete' :: Merged x x > NonEmpty x
 discrete :: Semigroup x => Merged x x > x
 mergeDiscrete' :: (Merge f, Functor f) => f x > f x > f (NonEmpty x)
 mergeDiscrete :: (Semigroup x, Merge f, Functor f) => f x > f x > f x
Documentation
Differentiates whether a value from either or both producers. In the case of one producer, additional identify if the other producer is live or dead.
data OtherStatus Source #
The other producer can be live (still yielding values), or dead
Differentiates when only one side is available (due to initial merge values of Nothing) or if two values (one of which may be a previous values) are availabe.
Coupled Source a b  
LeftOnly OtherStatus a  
RightOnly OtherStatus b 
(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

(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

discreteLeft :: Merged x y > Maybe x Source #
Keep only the values originated from the left, replacing other yields with Nothing. This is useful when React is based on STM, since filtering with Producer STM results in larger STM transactions which may result in blocking.
discreteRight :: Merged x y > Maybe y Source #
Keep only the values originated from the right, replacing other yields with Nothing. This is useful when React is based on STM, since filtering with Producer STM results in larger STM transactions which may result in blocking.
discreteBoth :: Merged x y > Maybe (x, y) Source #
Keep only the values originated from both, replacing other yields with Nothing. This is useful when React is based on STM, since filtering with Producer STM results in larger STM transactions which may result in blocking.
discrete :: Semigroup x => Merged x x > x Source #
Keep only the "new" values (using semigroup <> when both values were active)