Hello community, here is the log from the commit of package ghc-conduit for openSUSE:Factory checked in at 2015-05-21 08:11:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-conduit (Old) and /work/SRC/openSUSE:Factory/.ghc-conduit.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-conduit" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-conduit/ghc-conduit.changes 2015-03-01 14:47:54.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-conduit.new/ghc-conduit.changes 2015-05-21 08:11:25.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Apr 22 08:15:09 UTC 2015 - [email protected] + +- update to 1.2.4 +* [fuseBothMaybe](https://github.com/snoyberg/conduit/issues/199) + +------------------------------------------------------------------- Old: ---- _service conduit-1.2.3.1.tar.gz New: ---- conduit-1.2.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-conduit.spec ++++++ --- /var/tmp/diff_new_pack.0VH6DT/_old 2015-05-21 08:11:26.000000000 +0200 +++ /var/tmp/diff_new_pack.0VH6DT/_new 2015-05-21 08:11:26.000000000 +0200 @@ -19,7 +19,7 @@ %global pkg_name conduit Name: ghc-conduit -Version: 1.2.3.1 +Version: 1.2.4 Release: 0 Summary: Streaming data processing library License: MIT ++++++ conduit-1.2.3.1.tar.gz -> conduit-1.2.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conduit-1.2.3.1/Data/Conduit/Internal/Conduit.hs new/conduit-1.2.4/Data/Conduit/Internal/Conduit.hs --- old/conduit-1.2.3.1/Data/Conduit/Internal/Conduit.hs 2014-12-15 22:14:49.000000000 +0100 +++ new/conduit-1.2.4/Data/Conduit/Internal/Conduit.hs 2015-02-19 07:34:30.000000000 +0100 @@ -76,6 +76,7 @@ , zipConduitApp , passthroughSink , fuseBoth + , fuseBothMaybe , fuseUpstream , sequenceSources , sequenceSinks @@ -1168,6 +1169,35 @@ ConduitM (pipeL (up Done) (withUpstream $ generalizeUpstream $ down Done) >>=) {-# INLINE fuseBoth #-} +-- | Like 'fuseBoth', but does not force consumption of the @Producer@. +-- In the case that the @Producer@ terminates, the result value is +-- provided as a @Just@ value. If it does not terminate, then a +-- @Nothing@ value is returned. +-- +-- One thing to note here is that "termination" here only occurs if the +-- @Producer@ actually yields a @Nothing@ value. For example, with the +-- @Producer@ @mapM_ yield [1..5]@, if five values are requested, the +-- @Producer@ has not yet terminated. Termination only occurs when the +-- sixth value is awaited for and the @Producer@ signals termination. +-- +-- Since 1.2.4 +fuseBothMaybe + :: Monad m + => ConduitM a b m r1 + -> ConduitM b c m r2 + -> ConduitM a c m (Maybe r1, r2) +fuseBothMaybe (ConduitM up) (ConduitM down) = + ConduitM (pipeL (up Done) (go Nothing $ down Done) >>=) + where + go mup (Done r) = Done (mup, r) + go mup (PipeM mp) = PipeM $ liftM (go mup) mp + go mup (HaveOutput p c o) = HaveOutput (go mup p) c o + go _ (NeedInput p c) = NeedInput + (\i -> go Nothing (p i)) + (\u -> go (Just u) (c ())) + go mup (Leftover p i) = Leftover (go mup p) i +{-# INLINABLE fuseBothMaybe #-} + -- | Same as @fuseBoth@, but ignore the return value from the downstream -- @Conduit@. Same caveats of forced consumption apply. -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conduit-1.2.3.1/Data/Conduit.hs new/conduit-1.2.4/Data/Conduit.hs --- old/conduit-1.2.3.1/Data/Conduit.hs 2014-12-15 22:14:49.000000000 +0100 +++ new/conduit-1.2.4/Data/Conduit.hs 2015-02-19 07:34:30.000000000 +0100 @@ -20,6 +20,7 @@ -- *** Fuse with upstream results , fuseBoth + , fuseBothMaybe , fuseUpstream -- ** Primitives diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conduit-1.2.3.1/changelog.md new/conduit-1.2.4/changelog.md --- old/conduit-1.2.3.1/changelog.md 2014-12-15 22:14:49.000000000 +0100 +++ new/conduit-1.2.4/changelog.md 2015-02-19 07:34:30.000000000 +0100 @@ -1,3 +1,7 @@ +## 1.2.4 + +* [fuseBothMaybe](https://github.com/snoyberg/conduit/issues/199) + __1.2.3__ Expose `connect` and `fuse` as synonyms for `$$` and `=$=`, respectively. __1.2.2__ Lots more stream fusion. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conduit-1.2.3.1/conduit.cabal new/conduit-1.2.4/conduit.cabal --- old/conduit-1.2.3.1/conduit.cabal 2014-12-15 22:14:49.000000000 +0100 +++ new/conduit-1.2.4/conduit.cabal 2015-02-19 07:34:30.000000000 +0100 @@ -1,5 +1,5 @@ Name: conduit -Version: 1.2.3.1 +Version: 1.2.4 Synopsis: Streaming data processing library. description: Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/conduit>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conduit-1.2.3.1/test/main.hs new/conduit-1.2.4/test/main.hs --- old/conduit-1.2.3.1/test/main.hs 2014-12-15 22:14:49.000000000 +0100 +++ new/conduit-1.2.4/test/main.hs 2015-02-19 07:34:30.000000000 +0100 @@ -942,6 +942,27 @@ return (x, y, z) res `shouldBe` (sum [1..5], ["hello"], [6..10]) + it "fuseBothMaybe with no result" $ do + let src = mapM_ C.yield [1 :: Int ..] + sink = CL.isolate 5 C.=$= CL.fold (+) 0 + (mup, down) <- C.runConduit $ C.fuseBothMaybe src sink + mup `shouldBe` (Nothing :: Maybe ()) + down `shouldBe` sum [1..5] + + it "fuseBothMaybe with result" $ do + let src = mapM_ C.yield [1 :: Int .. 5] + sink = CL.isolate 6 C.=$= CL.fold (+) 0 + (mup, down) <- C.runConduit $ C.fuseBothMaybe src sink + mup `shouldBe` Just () + down `shouldBe` sum [1..5] + + it "fuseBothMaybe with almost result" $ do + let src = mapM_ C.yield [1 :: Int .. 5] + sink = CL.isolate 5 C.=$= CL.fold (+) 0 + (mup, down) <- C.runConduit $ C.fuseBothMaybe src sink + mup `shouldBe` (Nothing :: Maybe ()) + down `shouldBe` sum [1..5] + describe "catching exceptions" $ do it "works" $ do let src = do
