Hello community,

here is the log from the commit of package ghc-conduit for openSUSE:Factory 
checked in at 2017-06-21 13:55:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-conduit (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-conduit.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-conduit"

Wed Jun 21 13:55:00 2017 rev:18 rq:504660 version:1.2.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-conduit/ghc-conduit.changes  2017-05-16 
14:46:39.770419505 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-conduit.new/ghc-conduit.changes     
2017-06-21 13:55:04.137335571 +0200
@@ -1,0 +2,5 @@
+Mon Jun 12 09:41:41 UTC 2017 - psim...@suse.com
+
+- Update to version 1.2.11.
+
+-------------------------------------------------------------------

Old:
----
  conduit-1.2.10.tar.gz

New:
----
  conduit-1.2.11.tar.gz

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

Other differences:
------------------
++++++ ghc-conduit.spec ++++++
--- /var/tmp/diff_new_pack.PNVwsB/_old  2017-06-21 13:55:06.461007796 +0200
+++ /var/tmp/diff_new_pack.PNVwsB/_new  2017-06-21 13:55:06.465007232 +0200
@@ -19,7 +19,7 @@
 %global pkg_name conduit
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.2.10
+Version:        1.2.11
 Release:        0
 Summary:        Streaming data processing library
 License:        MIT

++++++ conduit-1.2.10.tar.gz -> conduit-1.2.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.2.10/ChangeLog.md 
new/conduit-1.2.11/ChangeLog.md
--- old/conduit-1.2.10/ChangeLog.md     2017-04-19 10:46:24.000000000 +0200
+++ new/conduit-1.2.11/ChangeLog.md     2017-06-09 16:35:46.000000000 +0200
@@ -1,3 +1,7 @@
+## 1.2.11
+
+* Add `unfoldEither` and `unfoldEitherM` to `Data.Conduit.List`
+
 ## 1.2.10
 
 * Add `PrimMonad` instances for `ConduitM` and `Pipe`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.2.10/Data/Conduit/Internal/List/Stream.hs 
new/conduit-1.2.11/Data/Conduit/Internal/List/Stream.hs
--- old/conduit-1.2.10/Data/Conduit/Internal/List/Stream.hs     2015-11-09 
03:09:15.000000000 +0100
+++ new/conduit-1.2.11/Data/Conduit/Internal/List/Stream.hs     2017-06-09 
16:35:46.000000000 +0200
@@ -23,6 +23,19 @@
             Just (x, s') -> Emit s' x
 {-# INLINE unfoldS #-}
 
+unfoldEitherS :: Monad m
+              => (b -> Either r (a, b))
+              -> b
+              -> StreamConduitM i a m r
+unfoldEitherS f s0 _ =
+    Stream step (return s0)
+  where
+    step s = return $
+        case f s of
+            Left r        -> Stop r
+            Right (x, s') -> Emit s' x
+{-# INLINE unfoldEitherS #-}
+
 unfoldMS :: Monad m
          => (b -> m (Maybe (a, b)))
          -> b
@@ -37,6 +50,19 @@
             Just (x, s') -> Emit s' x
 {-# INLINE unfoldMS #-}
 
+unfoldEitherMS :: Monad m
+         => (b -> m (Either r (a, b)))
+         -> b
+         -> StreamConduitM i a m r
+unfoldEitherMS f s0 _ =
+    Stream step (return s0)
+  where
+    step s = do
+        ms' <- f s
+        return $ case ms' of
+            Left r        -> Stop r
+            Right (x, s') -> Emit s' x
+{-# INLINE unfoldEitherMS #-}
 sourceListS :: Monad m => [a] -> StreamProducer m a
 sourceListS xs0 _ =
     Stream (return . step) (return xs0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.2.10/Data/Conduit/List.hs 
new/conduit-1.2.11/Data/Conduit/List.hs
--- old/conduit-1.2.10/Data/Conduit/List.hs     2017-02-08 06:03:05.000000000 
+0100
+++ new/conduit-1.2.11/Data/Conduit/List.hs     2017-06-09 16:35:46.000000000 
+0200
@@ -19,7 +19,9 @@
       sourceList
     , sourceNull
     , unfold
+    , unfoldEither
     , unfoldM
+    , unfoldEitherM
     , enumFromTo
     , iterate
     , replicate
@@ -73,6 +75,7 @@
 import Prelude
     ( ($), return, (==), (-), Int
     , (.), id, Maybe (..), Monad
+    , Either (..)
     , Bool (..)
     , (>>)
     , (>>=)
@@ -114,6 +117,25 @@
 {-# INLINE unfoldC #-}
 STREAMING(unfold, unfoldC, unfoldS, f x)
 
+-- | Generate a source from a seed value with a return value.
+--
+-- Subject to fusion
+--
+-- @since 1.2.11
+unfoldEither, unfoldEitherC :: Monad m
+                            => (b -> Either r (a, b))
+                            -> b
+                            -> ConduitM i a m r
+unfoldEitherC f =
+    go
+  where
+    go seed =
+        case f seed of
+            Right (a, seed') -> yield a >> go seed'
+            Left r -> return r
+{-# INLINE unfoldEitherC #-}
+STREAMING(unfoldEither, unfoldEitherC, unfoldEitherS, f x)
+
 -- | A monadic unfold.
 --
 -- Subject to fusion
@@ -133,6 +155,25 @@
             Nothing -> return ()
 STREAMING(unfoldM, unfoldMC, unfoldMS, f seed)
 
+-- | A monadic unfoldEither.
+--
+-- Subject to fusion
+--
+-- @since 1.2.11
+unfoldEitherM, unfoldEitherMC :: Monad m
+                              => (b -> m (Either r (a, b)))
+                              -> b
+                              -> ConduitM i a m r
+unfoldEitherMC f =
+    go
+  where
+    go seed = do
+        mres <- lift $ f seed
+        case mres of
+            Right (a, seed') -> yield a >> go seed'
+            Left r -> return r
+STREAMING(unfoldEitherM, unfoldEitherMC, unfoldEitherMS, f seed)
+
 -- | Yield the values from the list.
 --
 -- Subject to fusion
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-1.2.10/conduit.cabal 
new/conduit-1.2.11/conduit.cabal
--- old/conduit-1.2.10/conduit.cabal    2017-04-19 10:44:16.000000000 +0200
+++ new/conduit-1.2.11/conduit.cabal    2017-06-09 16:35:46.000000000 +0200
@@ -1,5 +1,5 @@
 Name:                conduit
-Version:             1.2.10
+Version:             1.2.11
 Synopsis:            Streaming data processing library.
 description:
     `conduit` is a solution to the streaming data problem, allowing for 
production,


Reply via email to