| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Pipes.Fluid.Merge
Synopsis
- 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.
Constructors
| FromBoth | |
| FromLeft OtherStatus | |
| FromRight OtherStatus |
Instances
| Eq Source # | |
| Ord Source # | |
| Show Source # | |
| Generic Source # | |
| type Rep Source # | |
Defined in Pipes.Fluid.Merge type Rep Source = D1 (MetaData "Source" "Pipes.Fluid.Merge" "pipes-fluid-0.6.0.1-5J6HnQmFcseA9yBK6VsOGH" False) (C1 (MetaCons "FromBoth" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "FromLeft" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 OtherStatus)) :+: C1 (MetaCons "FromRight" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 OtherStatus)))) | |
data OtherStatus #
The other producer can be live (still yielding values), or dead
Instances
| Eq OtherStatus # | |
Defined in Pipes.Fluid.Merge | |
| Ord OtherStatus # | |
Defined in Pipes.Fluid.Merge Methods compare :: OtherStatus -> OtherStatus -> Ordering # (<) :: OtherStatus -> OtherStatus -> Bool # (<=) :: OtherStatus -> OtherStatus -> Bool # (>) :: OtherStatus -> OtherStatus -> Bool # (>=) :: OtherStatus -> OtherStatus -> Bool # max :: OtherStatus -> OtherStatus -> OtherStatus # min :: OtherStatus -> OtherStatus -> OtherStatus # | |
| Show OtherStatus # | |
Defined in Pipes.Fluid.Merge Methods showsPrec :: Int -> OtherStatus -> ShowS # show :: OtherStatus -> String # showList :: [OtherStatus] -> ShowS # | |
| Generic OtherStatus # | |
Defined in Pipes.Fluid.Merge Associated Types type Rep OtherStatus :: * -> * # | |
| type Rep OtherStatus # | |
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.
Constructors
| Coupled Source a b | |
| LeftOnly OtherStatus a | |
| RightOnly OtherStatus b |
Instances
isBothLive :: Merged x y -> Bool #
This can be used with takeWhile
isLeftLive :: Merged x y -> Bool #
This can be used with takeWhile
isRightLive :: Merged x y -> Bool #
This can be used with takeWhile
isRightDead :: Merged x y -> Bool #
This can be used with takeWhile
isLeftDead :: Merged x y -> Bool #
This can be used with takeWhile
Minimal complete definition
Instances
| (MonadBaseControl IO m, Forall (Pure m)) => Merge (ImpulseIO m) # | 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) # | 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 #
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 #
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) #
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 #
Keep only the "new" values (using semigroup <> when both values were active)
mergeDiscrete' :: (Merge f, Functor f) => f x -> f x -> f (NonEmpty x) #
merge two producers of the same type together.
mergeDiscrete :: (Semigroup x, Merge f, Functor f) => f x -> f x -> f x #
merge two producers of the same type together (using semigroup <> when both values were active)