Hello community,
here is the log from the commit of package ghc-io-streams for openSUSE:Factory checked in at 2017-03-24 02:18:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-io-streams (Old)
and /work/SRC/openSUSE:Factory/.ghc-io-streams.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-io-streams"
Fri Mar 24 02:18:46 2017 rev:2 rq:479412 version:1.3.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-io-streams/ghc-io-streams.changes 2017-03-08 00:58:19.463558525 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-io-streams.new/ghc-io-streams.changes 2017-03-24 02:18:48.084286654 +0100
@@ -1,0 +2,10 @@
+Mon Jan 23 20:28:15 UTC 2017 - psimons@suse.com
+
+- Update to version 1.3.6.0 revision 1 with cabal2obs.
+
+-------------------------------------------------------------------
+Wed Jan 18 09:00:09 UTC 2017 - psimons@suse.com
+
+- Update to version 1.3.6.0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
io-streams-1.3.5.0.tar.gz
New:
----
io-streams-1.3.6.0.tar.gz
io-streams.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-io-streams.spec ++++++
--- /var/tmp/diff_new_pack.vW8rf4/_old 2017-03-24 02:18:49.140137261 +0100
+++ /var/tmp/diff_new_pack.vW8rf4/_new 2017-03-24 02:18:49.140137261 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-io-streams
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,15 +19,15 @@
%global pkg_name io-streams
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.3.5.0
+Version: 1.3.6.0
Release: 0
Summary: Simple, composable, and easy-to-use stream I/O
License: BSD-3-Clause
-Group: System/Libraries
+Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
BuildRequires: ghc-attoparsec-devel
BuildRequires: ghc-bytestring-builder-devel
BuildRequires: ghc-bytestring-devel
@@ -53,7 +53,6 @@
BuildRequires: ghc-test-framework-quickcheck2-devel
BuildRequires: ghc-zlib-devel
%endif
-# End cabal-rpm deps
%description
/Overview/
@@ -125,21 +124,16 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
%post devel
%ghc_pkg_recache
@@ -153,6 +147,6 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
-%doc README.md changelog.md
+%doc CONTRIBUTORS README.md changelog.md
%changelog
++++++ io-streams-1.3.5.0.tar.gz -> io-streams-1.3.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/io-streams-1.3.5.0/changelog.md new/io-streams-1.3.6.0/changelog.md
--- old/io-streams-1.3.5.0/changelog.md 2016-01-08 19:57:21.000000000 +0100
+++ new/io-streams-1.3.6.0/changelog.md 2017-01-13 21:51:17.000000000 +0100
@@ -1,3 +1,18 @@
+# Version 1.3.6.0
+ - Added new fold functions:
+ ```haskell
+fold_ :: (x -> a -> x) -- ^ accumulator update function
+ -> x -- ^ initial seed
+ -> (x -> s) -- ^ recover folded value
+ -> InputStream a -- ^ input stream
+ -> IO s
+foldM_ :: (x -> a -> IO x) -- ^ accumulator update action
+ -> IO x -- ^ initial seed
+ -> (x -> IO s) -- ^ recover folded value
+ -> InputStream a -- ^ input stream
+ -> IO s
+ ```
+
# Version 1.3.5.0
- Add support for latest `process`, `time`, and `transformers` releases
(and thereby indirectly for the upcoming GHC 8.0).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/io-streams-1.3.5.0/io-streams.cabal new/io-streams-1.3.6.0/io-streams.cabal
--- old/io-streams-1.3.5.0/io-streams.cabal 2016-01-08 19:57:21.000000000 +0100
+++ new/io-streams-1.3.6.0/io-streams.cabal 2017-01-13 21:51:17.000000000 +0100
@@ -1,5 +1,5 @@
Name: io-streams
-Version: 1.3.5.0
+Version: 1.3.6.0
License: BSD3
License-file: LICENSE
Category: Data, Network, IO-Streams
@@ -92,7 +92,7 @@
ghc-options: -Wall -fwarn-tabs -funbox-strict-fields
-fno-warn-unused-do-bind
- ghc-prof-options: -prof -auto-all
+ ghc-prof-options: -auto-all
Exposed-modules: System.IO.Streams,
System.IO.Streams.Attoparsec,
@@ -193,7 +193,7 @@
ghc-options: -Wall -fhpc -fwarn-tabs -funbox-strict-fields -threaded
-fno-warn-unused-do-bind
- ghc-prof-options: -prof -auto-all
+ ghc-prof-options: -auto-all
if !os(windows) && !flag(NoInteractiveTests)
cpp-options: -DENABLE_PROCESS_TESTS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/io-streams-1.3.5.0/src/System/IO/Streams/Combinators.hs new/io-streams-1.3.6.0/src/System/IO/Streams/Combinators.hs
--- old/io-streams-1.3.5.0/src/System/IO/Streams/Combinators.hs 2016-01-08 19:57:21.000000000 +0100
+++ new/io-streams-1.3.6.0/src/System/IO/Streams/Combinators.hs 2017-01-13 21:51:17.000000000 +0100
@@ -10,6 +10,8 @@
, outputFoldM
, fold
, foldM
+ , fold_
+ , foldM_
, any
, all
, maximum
@@ -182,6 +184,61 @@
------------------------------------------------------------------------------
+-- | A variant of 'System.IO.Streams.fold' suitable for use with composable folds
+-- from \'beautiful folding\' libraries like
+-- <http://hackage.haskell.org/package/foldl the foldl library>.
+-- The input stream is fully consumed.
+--
+-- Example:
+--
+-- @
+-- ghci> let folds = liftA3 (,,) Foldl.length Foldl.mean Foldl.maximum
+-- ghci> Streams.'System.IO.Streams.fromList' [1..10::Double] >>= Foldl.purely Streams.'System.IO.Streams.fold_' folds is
+-- ghci> (10,5.5,Just 10.0)
+-- @
+--
+-- /Since 1.3.6.0/
+--
+fold_ :: (x -> a -> x) -- ^ accumulator update function
+ -> x -- ^ initial seed
+ -> (x -> s) -- ^ recover folded value
+ -> InputStream a -- ^ input stream
+ -> IO s
+fold_ op seed done stream = liftM done (go seed)
+ where
+ go !s = read stream >>= maybe (return s) (go . op s)
+
+
+------------------------------------------------------------------------------
+-- | A variant of 'System.IO.Streams.foldM' suitable for use with composable folds
+-- from \'beautiful folding\' libraries like
+-- <http://hackage.haskell.org/package/foldl the foldl library>.
+-- The input stream is fully consumed.
+--
+-- Example:
+--
+-- @
+-- ghci> let folds = Foldl.mapM_ print *> Foldl.generalize (liftA2 (,) Foldl.sum Foldl.mean)
+-- ghci> Streams.'System.IO.Streams.fromList' [1..3::Double] >>= Foldl.impurely Streams.'System.IO.Streams.foldM_' folds
+-- 1.0
+-- 2.0
+-- 3.0
+-- (6.0,2.0)
+-- @
+--
+-- /Since 1.3.6.0/
+--
+foldM_ :: (x -> a -> IO x) -- ^ accumulator update action
+ -> IO x -- ^ initial seed
+ -> (x -> IO s) -- ^ recover folded value
+ -> InputStream a -- ^ input stream
+ -> IO s
+foldM_ f seed done stream = seed >>= go
+ where
+ go !x = read stream >>= maybe (done x) ((go =<<) . f x)
+
+
+------------------------------------------------------------------------------
-- | @any predicate stream@ returns 'True' if any element in @stream@ matches
-- the predicate.
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/io-streams-1.3.5.0/test/System/IO/Streams/Tests/Combinators.hs new/io-streams-1.3.6.0/test/System/IO/Streams/Tests/Combinators.hs
--- old/io-streams-1.3.5.0/test/System/IO/Streams/Tests/Combinators.hs 2016-01-08 19:57:21.000000000 +0100
+++ new/io-streams-1.3.6.0/test/System/IO/Streams/Tests/Combinators.hs 2017-01-13 21:51:17.000000000 +0100
@@ -40,6 +40,8 @@
, testFoldMWorksTwice
, testFold
, testFoldM
+ , testFold_
+ , testFoldM_
, testUnfoldM
, testPredicates
, testMap
@@ -235,6 +237,19 @@
------------------------------------------------------------------------------
+testFold_ :: Test
+testFold_ = testCase "combinators/fold_" $ do
+ fromList [1..10::Int] >>= S.fold_ (+) 0 id
+ >>= assertEqual "fold_1" (sum [1..10])
+
+------------------------------------------------------------------------------
+testFoldM_ :: Test
+testFoldM_ = testCase "combinators/foldM_" $ do
+ fromList [1..10::Int] >>= S.foldM_ ((return .) . (+)) (return 0) return
+ >>= assertEqual "fold_2" (sum [1..10])
+
+
+------------------------------------------------------------------------------
testUnfoldM :: Test
testUnfoldM = testCase "combinators/unfoldM" $ do
S.unfoldM gen 0 >>= toList >>= assertEqual "unfold" result
++++++ io-streams.cabal ++++++
Name: io-streams
Version: 1.3.6.0
x-revision: 1
License: BSD3
License-file: LICENSE
Category: Data, Network, IO-Streams
Build-type: Simple
Maintainer: Gregory Collins