Hello community,

here is the log from the commit of package ghc-conduit for openSUSE:Factory 
checked in at 2019-12-27 13:52:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-conduit (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-conduit.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-conduit"

Fri Dec 27 13:52:23 2019 rev:24 rq:759364 version:1.3.1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-conduit/ghc-conduit.changes  2019-03-19 
09:59:37.472059340 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-conduit.new.6675/ghc-conduit.changes        
2019-12-27 13:52:25.088618168 +0100
@@ -1,0 +2,13 @@
+Tue Dec 17 03:03:25 UTC 2019 - psim...@suse.com
+
+- Update conduit to version 1.3.1.2.
+  ## 1.3.1.2
+
+  * More eagerly emit groups in `chunksOf` 
[#427](https://github.com/snoyberg/conduit/pull/427)
+
+-------------------------------------------------------------------
+Fri Nov  8 16:13:28 UTC 2019 - Peter Simons <psim...@suse.com>
+
+- Drop obsolete group attributes.
+
+-------------------------------------------------------------------

Old:
----
  conduit-1.3.1.1.tar.gz

New:
----
  conduit-1.3.1.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-conduit.spec ++++++
--- /var/tmp/diff_new_pack.4jBO8H/_old  2019-12-27 13:52:25.540618489 +0100
+++ /var/tmp/diff_new_pack.4jBO8H/_new  2019-12-27 13:52:25.540618489 +0100
@@ -19,11 +19,10 @@
 %global pkg_name conduit
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.3.1.1
+Version:        1.3.1.2
 Release:        0
 Summary:        Streaming data processing library
 License:        MIT
-Group:          Development/Libraries/Haskell
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
 BuildRequires:  ghc-Cabal-devel
@@ -66,7 +65,6 @@
 
 %package devel
 Summary:        Haskell %{pkg_name} library development files
-Group:          Development/Libraries/Haskell
 Requires:       %{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}

++++++ conduit-1.3.1.1.tar.gz -> conduit-1.3.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.3.1.1/ChangeLog.md 
new/conduit-1.3.1.2/ChangeLog.md
--- old/conduit-1.3.1.1/ChangeLog.md    2019-03-12 08:53:53.000000000 +0100
+++ new/conduit-1.3.1.2/ChangeLog.md    2019-12-16 06:37:44.000000000 +0100
@@ -1,5 +1,9 @@
 # ChangeLog for conduit
 
+## 1.3.1.2
+
+* More eagerly emit groups in `chunksOf` 
[#427](https://github.com/snoyberg/conduit/pull/427)
+
 ## 1.3.1.1
 
 * Use lower-case imports (better for cross-compilation) 
[#408](https://github.com/snoyberg/conduit/pull/408)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.3.1.1/conduit.cabal 
new/conduit-1.3.1.2/conduit.cabal
--- old/conduit-1.3.1.1/conduit.cabal   2019-03-12 08:53:59.000000000 +0100
+++ new/conduit-1.3.1.2/conduit.cabal   2019-12-16 06:37:44.000000000 +0100
@@ -1,5 +1,5 @@
 Name:                conduit
-Version:             1.3.1.1
+Version:             1.3.1.2
 Synopsis:            Streaming data processing library.
 description:
     `conduit` is a solution to the streaming data problem, allowing for 
production,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.3.1.1/src/Data/Conduit/List.hs 
new/conduit-1.3.1.2/src/Data/Conduit/List.hs
--- old/conduit-1.3.1.1/src/Data/Conduit/List.hs        2018-04-11 
15:18:24.000000000 +0200
+++ new/conduit-1.3.1.2/src/Data/Conduit/List.hs        2019-12-16 
06:37:44.000000000 +0100
@@ -88,6 +88,9 @@
     , maybe
     , (<=)
     , (>)
+    , error
+    , (++)
+    , show
     )
 import Data.Monoid (Monoid, mempty, mappend)
 import qualified Data.Foldable as F
@@ -684,17 +687,14 @@
 --
 -- Since 1.2.9
 chunksOf :: Monad m => Int -> ConduitT a [a] m ()
-chunksOf n =
-    start
+chunksOf n = if n > 0 then loop n id else error $ "chunksOf size must be 
positive (given " ++ show n ++ ")"
   where
-    start = await >>= maybe (return ()) (\x -> loop n (x:))
-
-    loop !count rest =
-        await >>= maybe (yield (rest [])) go
-      where
-        go y
-            | count > 1 = loop (count - 1) (rest . (y:))
-            | otherwise = yield (rest []) >> loop n (y:)
+    loop 0 rest = yield (rest []) >> loop n id
+    loop count rest = await >>= \ma -> case ma of
+      Nothing -> case rest [] of
+        [] -> return ()
+        nonempty -> yield nonempty
+      Just a -> loop (count - 1) (rest . (a :))
 
 -- | Grouping input according to an equality function.
 --
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.3.1.1/test/main.hs 
new/conduit-1.3.1.2/test/main.hs
--- old/conduit-1.3.1.1/test/main.hs    2018-03-14 07:08:08.000000000 +0100
+++ new/conduit-1.3.1.2/test/main.hs    2019-12-16 06:37:44.000000000 +0100
@@ -5,6 +5,7 @@
 {-# OPTIONS_GHC -fno-warn-orphans #-}
 import Test.Hspec
 import Test.Hspec.QuickCheck (prop)
+import Test.QuickCheck (getPositive)
 import Test.QuickCheck.Monadic (assert, monadicIO, run)
 
 import Data.Conduit (runConduit, (.|), ConduitT, runConduitPure, runConduitRes)
@@ -13,7 +14,7 @@
 import qualified Data.Conduit.Internal as CI
 import qualified Data.Conduit.List as CL
 import Data.Typeable (Typeable)
-import Control.Exception (throw)
+import Control.Exception (throw, evaluate)
 import Control.Monad.Trans.Resource (runResourceT)
 import Control.Monad.Trans.Maybe (MaybeT (MaybeT))
 import Control.Monad.State.Strict (modify)
@@ -241,11 +242,18 @@
                     .| CL.fold (+) 0
             x `shouldBe` 2 * sum [1..10 :: Int]
 
-        prop "chunksOf" $ equivToList
-            (DLS.chunksOf 5 :: [Int]->[[Int]]) (CL.chunksOf 5)
-
-        prop "chunksOf (negative)" $ equivToList
-            (map (:[]) :: [Int]->[[Int]]) (CL.chunksOf (-5))
+        prop "chunksOf" $ \(positive, xs) ->
+            let p = getPositive positive
+                conduit = CL.sourceList xs .| CL.chunksOf p .| CL.consume
+            in DLS.chunksOf p (xs :: [Int]) == runConduitPure conduit
+
+        it "chunksOf (zero)" $
+            let conduit = return () .| CL.chunksOf 0 .| CL.consume
+            in evaluate (runConduitPure conduit) `shouldThrow` anyException
+
+        it "chunksOf (negative)" $
+            let conduit = return () .| CL.chunksOf (-5) .| CL.consume
+            in evaluate (runConduitPure conduit) `shouldThrow` anyException
 
         it "groupBy" $ do
             let input = [1::Int, 1, 2, 3, 3, 3, 4, 5, 5]


Reply via email to