pipes-fluid 0.5.0.3 → 0.6.0.0
raw patch · 5 files changed
+2/−19 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- pipes-fluid.cabal +2/−2
- src/Pipes/Fluid/Impulse.hs +0/−5
- src/Pipes/Fluid/ImpulseIO.hs +0/−5
- src/Pipes/Fluid/Merge.hs +0/−6
- test/Spec.hs +0/−1
pipes-fluid.cabal view
@@ -1,7 +1,7 @@ name: pipes-fluid-version: 0.5.0.3+version: 0.6.0.0 synopsis: Reactively combines Producers so that a value is yielded as soon as possible.-description: Please see README.md+description: Reactively combines Producers so that a value is yielded as soon as possible. homepage: https://github.com/louispan/pipes-fluid#readme license: BSD3 license-file: LICENSE
src/Pipes/Fluid/Impulse.hs view
@@ -40,7 +40,6 @@ instance Monad m => Functor (Impulse m) where fmap f (Impulse as) = Impulse $ as P.>-> PP.map f- {-# INLINABLE fmap #-} -- | Impulseively combines two producers, given initial values to use when the producer is blocked/failed. -- This only works for Alternative m where failure means there was no effects, eg. 'Control.Concurrent.STM', or @MonadTrans t => t STM@.@@ -48,7 +47,6 @@ instance (Alternative m, Monad m) => Applicative (Impulse m) where pure = Impulse . P.yield- {-# INLINABLE pure #-} fs <*> as = Impulse $@@ -59,7 +57,6 @@ -- fail/retry/block until we get something from the other signal LeftOnly _ _ -> lift empty RightOnly _ _-> lift empty- {-# INLINABLE (<*>) #-} -- | 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@@ -118,7 +115,6 @@ These (Right (x, xs')) (Right (y, ys')) -> do P.yield $ Coupled FromBoth x y go (Just x) (Just y) xs' ys'- {-# INLINABLE merge' #-} -- | Used internally by Impulse and ImpulseIO identifying which side (or both) returned values bothOrEither :: Alternative f => f a -> f b -> f (These a b)@@ -128,4 +124,3 @@ (This <$> left) <|> (That <$> right)-{-# INLINABLE bothOrEither #-}
src/Pipes/Fluid/ImpulseIO.hs view
@@ -49,11 +49,9 @@ instance Monad m => Functor (ImpulseIO m) where fmap f (ImpulseIO as) = ImpulseIO $ as P.>-> PP.map f- {-# INLINABLE fmap #-} instance (MonadBaseControl IO m, Forall (A.Pure m)) => Applicative (ImpulseIO m) where pure = ImpulseIO . P.yield- {-# INLINABLE pure #-} -- 'ap' doesn't know about initial values fs <*> as = ImpulseIO $ P.for (impulsivelyIO $ merge fs as) $ \r ->@@ -63,7 +61,6 @@ -- drop the event LeftOnly _ _ -> pure () RightOnly _ _-> pure ()- {-# INLINABLE (<*>) #-} -- | 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@@ -156,7 +153,6 @@ ax' <- lift $ A.async $ P.next xs' ay' <- lift $ A.async $ P.next ys' doMergeIO (Just x) (Just y) ax' ay'- {-# INLINABLE merge' #-} -- | Used internally by Impulse and ImpulseIO identifying which side (or both) returned values bothOrEither :: Alternative f => f a -> f b -> f (These a b)@@ -166,4 +162,3 @@ (This <$> left) <|> (That <$> right)-{-# INLINABLE bothOrEither #-}
src/Pipes/Fluid/Merge.hs view
@@ -32,7 +32,6 @@ isBothLive (LeftOnly OtherLive _) = True isBothLive (RightOnly OtherLive _) = True isBothLive _ = False-{-# INLINABLE isBothLive #-} -- | This can be used with 'Pipes.Prelude.takeWhile' isLeftLive :: Merged x y -> Bool@@ -42,7 +41,6 @@ isLeftLive (LeftOnly _ _) = True isLeftLive (RightOnly OtherLive _) = True isLeftLive _ = False-{-# INLINABLE isLeftLive #-} -- | This can be used with 'Pipes.Prelude.takeWhile' isRightLive :: Merged x y -> Bool@@ -52,28 +50,24 @@ isRightLive (RightOnly _ _) = True isRightLive (LeftOnly OtherLive _) = True isRightLive _ = False-{-# INLINABLE isRightLive #-} -- | This can be used with 'Pipes.Prelude.takeWhile' isRightDead :: Merged x y -> Bool isRightDead (Coupled (FromLeft OtherDead) _ _) = True isRightDead (LeftOnly OtherDead _) = True isRightDead _ = False-{-# INLINABLE isRightDead #-} -- | This can be used with 'Pipes.Prelude.takeWhile' isLeftDead :: Merged x y -> Bool isLeftDead (Coupled (FromRight OtherDead) _ _) = True isLeftDead (RightOnly OtherDead _) = True isLeftDead _ = False-{-# INLINABLE isLeftDead #-} class Merge f where merge' :: Maybe x -> Maybe y -> f x -> f y -> f (Merged x y) merge :: Merge f => f x -> f y -> f (Merged x y) merge = merge' Nothing Nothing-{-# INLINABLE merge #-} -- | 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
test/Spec.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE MonomorphismRestriction #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-}