| Safe Haskell | Safe-Inferred |
|---|---|
| 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 :: Type -> Type) 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
data OtherStatus Source #
The other producer can be live (still yielding values), or dead
Instances
| Generic OtherStatus Source # | |||||
Defined in Pipes.Fluid.Merge Associated Types
| |||||
| Show OtherStatus Source # | |||||
Defined in Pipes.Fluid.Merge Methods showsPrec :: Int -> OtherStatus -> ShowS # show :: OtherStatus -> String # showList :: [OtherStatus] -> ShowS # | |||||
| Eq OtherStatus Source # | |||||
Defined in Pipes.Fluid.Merge | |||||
| Ord OtherStatus Source # | |||||
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 # | |||||
| type Rep OtherStatus Source # | |||||
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
| Generic (Merged a b) Source # | |||||
Defined in Pipes.Fluid.Merge Associated Types
| |||||
| (Show a, Show b) => Show (Merged a b) Source # | |||||
| (Eq a, Eq b) => Eq (Merged a b) Source # | |||||
| (Ord a, Ord b) => Ord (Merged a b) Source # | |||||
| type Rep (Merged a b) Source # | |||||
Defined in Pipes.Fluid.Merge type Rep (Merged a b) = D1 ('MetaData "Merged" "Pipes.Fluid.Merge" "pipes-fluid-0.6.0.1-JDaC03lr0Yu2ctLwFl84Qe" 'False) (C1 ('MetaCons "Coupled" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Source) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b))) :+: (C1 ('MetaCons "LeftOnly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OtherStatus) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "RightOnly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OtherStatus) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)))) | |||||
class Merge (f :: Type -> Type) where Source #
Instances
| (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
|
| (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
|
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)