Hello community,

here is the log from the commit of package ghc-foldl for openSUSE:Factory 
checked in at 2017-06-04 01:57:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-foldl (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-foldl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-foldl"

Sun Jun  4 01:57:18 2017 rev:7 rq:499696 version:1.2.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-foldl/ghc-foldl.changes      2017-04-11 
09:42:35.506875714 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-foldl.new/ghc-foldl.changes 2017-06-04 
01:57:20.725252679 +0200
@@ -1,0 +2,5 @@
+Thu May 18 09:52:23 UTC 2017 - [email protected]
+
+- Update to version 1.2.5 with cabal2obs.
+
+-------------------------------------------------------------------

Old:
----
  foldl-1.2.4.tar.gz

New:
----
  foldl-1.2.5.tar.gz

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

Other differences:
------------------
++++++ ghc-foldl.spec ++++++
--- /var/tmp/diff_new_pack.QVLjs0/_old  2017-06-04 01:57:21.261176966 +0200
+++ /var/tmp/diff_new_pack.QVLjs0/_new  2017-06-04 01:57:21.265176401 +0200
@@ -18,7 +18,7 @@
 
 %global pkg_name foldl
 Name:           ghc-%{pkg_name}
-Version:        1.2.4
+Version:        1.2.5
 Release:        0
 Summary:        Composable, streaming, and efficient left folds
 License:        BSD-3-Clause
@@ -30,12 +30,14 @@
 BuildRequires:  ghc-comonad-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-contravariant-devel
+BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-mwc-random-devel
 BuildRequires:  ghc-primitive-devel
 BuildRequires:  ghc-profunctors-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vector-devel
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 

++++++ foldl-1.2.4.tar.gz -> foldl-1.2.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foldl-1.2.4/CHANGELOG.md new/foldl-1.2.5/CHANGELOG.md
--- old/foldl-1.2.4/CHANGELOG.md        2017-03-25 05:01:04.000000000 +0100
+++ new/foldl-1.2.5/CHANGELOG.md        2017-05-01 19:04:49.000000000 +0200
@@ -1,3 +1,17 @@
+1.2.5
+
+* Add support for folding new containers: `hashSet`, `map`, and `hashMap`
+* Add `prescan`/`postscan` which generalize `scan` to `Traversable` types
+
+1.2.4
+
+* Add `lazy` folds for `Text` and `ByteString`
+* Documentation fixes and improvements
+
+1.2.3
+
+* Add `lookup`
+
 1.2.2
 
 * Add numerically stable `mean`, `variance`, and `std` folds
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foldl-1.2.4/README.md new/foldl-1.2.5/README.md
--- old/foldl-1.2.4/README.md   2017-03-25 05:01:04.000000000 +0100
+++ new/foldl-1.2.5/README.md   2017-05-01 19:04:49.000000000 +0200
@@ -1,4 +1,4 @@
-# `foldl` v1.2.4
+# `foldl` v1.2.5
 
 Use this `foldl` library when you want to compute multiple folds over a
 collection in one pass over the data without space leaks.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foldl-1.2.4/bench/benchmarks.hs 
new/foldl-1.2.5/bench/benchmarks.hs
--- old/foldl-1.2.4/bench/benchmarks.hs 2017-03-25 05:01:04.000000000 +0100
+++ new/foldl-1.2.5/bench/benchmarks.hs 2017-05-01 19:04:49.000000000 +0200
@@ -1,6 +1,6 @@
 module Main (main) where
 
-import Control.Foldl
+import Control.Foldl hiding (map)
 import Criterion.Main
 import qualified Data.List
 import Prelude hiding (length, sum)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foldl-1.2.4/foldl.cabal new/foldl-1.2.5/foldl.cabal
--- old/foldl-1.2.4/foldl.cabal 2017-03-25 05:01:04.000000000 +0100
+++ new/foldl-1.2.5/foldl.cabal 2017-05-01 19:04:49.000000000 +0200
@@ -1,5 +1,5 @@
 Name: foldl
-Version: 1.2.4
+Version: 1.2.5
 Cabal-Version: >=1.8.0.2
 Build-Type: Simple
 License: BSD3
@@ -33,6 +33,8 @@
         transformers >= 0.2.0.0  && < 0.6 ,
         vector       >= 0.7      && < 0.13,
         containers                  < 0.6 ,
+        unordered-containers        < 0.3 ,
+        hashable                    < 1.3 ,
         contravariant               < 1.5 ,
         profunctors                 < 5.3 ,
         comonad      >= 4.0      && < 6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foldl-1.2.4/src/Control/Foldl.hs 
new/foldl-1.2.5/src/Control/Foldl.hs
--- old/foldl-1.2.4/src/Control/Foldl.hs        2017-03-25 05:01:04.000000000 
+0100
+++ new/foldl-1.2.5/src/Control/Foldl.hs        2017-05-01 19:04:49.000000000 
+0200
@@ -35,6 +35,7 @@
     executables that use this library to further improve performance.
 -}
 
+{-# LANGUAGE CPP                       #-}
 {-# LANGUAGE ExistentialQuantification #-}
 {-# LANGUAGE FlexibleContexts          #-}
 {-# LANGUAGE RankNTypes                #-}
@@ -49,6 +50,11 @@
     , fold
     , foldM
     , scan
+#if MIN_VERSION_base(4,8,0)
+    , prescan
+    , postscan
+#else
+#endif
 
     -- * Folds
     , Control.Foldl.mconcat
@@ -94,6 +100,9 @@
     , nub
     , eqNub
     , set
+    , hashSet
+    , map
+    , hashMap
     , vector
 
     -- * Utilities
@@ -139,6 +148,7 @@
 import Data.Sequence ((|>))
 import Data.Vector.Generic (Vector, Mutable)
 import Data.Vector.Generic.Mutable (MVector)
+import Data.Hashable (Hashable)
 import System.Random.MWC (GenIO, createSystemRandom, uniformR)
 import Prelude hiding
     ( head
@@ -156,12 +166,16 @@
     , elem
     , notElem
     , lookup
+    , map
     )
 
 import qualified Data.Foldable               as F
 import qualified Data.List                   as List
 import qualified Data.Sequence               as Seq
 import qualified Data.Set                    as Set
+import qualified Data.Map.Strict             as Map
+import qualified Data.HashMap.Strict         as HashMap
+import qualified Data.HashSet                as HashSet
 import qualified Data.Vector.Generic         as V
 import qualified Data.Vector.Generic.Mutable as M
 
@@ -461,6 +475,37 @@
     cons a k x = done x:(k $! step x a)
 {-# INLINE scan #-}
 
+#if MIN_VERSION_base(4,8,0)
+{-| Convert a `Fold` into a prescan for any `Traversable` type
+
+    \"Prescan\" means that the last element of the scan is not included
+-}
+prescan :: Traversable t => Fold a b -> t a -> t b
+prescan (Fold step begin done) as = bs
+  where
+    step' x a = (x', b)
+      where
+        x' = step x a
+        b  = done x
+    (_, bs) = List.mapAccumL step' begin as
+{-# INLINE prescan #-}
+
+{-| Convert a `Fold` into a postscan for any `Traversable` type
+
+    \"Postscan\" means that the first element of the scan is not included
+-}
+postscan :: Traversable t => Fold a b -> t a -> t b
+postscan (Fold step begin done) as = bs
+  where
+    step' x a = (x', b)
+      where
+        x' = step x a
+        b  = done x'
+    (_, bs) = List.mapAccumL step' begin as
+{-# INLINE postscan #-}
+#else
+#endif
+
 -- | Fold all values within a container using 'mappend' and 'mempty'
 mconcat :: Monoid a => Fold a a
 mconcat = Fold mappend mempty id
@@ -824,6 +869,33 @@
 set = Fold (flip Set.insert) Set.empty id
 {-# INLINABLE set #-}
 
+-- | Fold values into a hash-set
+hashSet :: (Eq a, Hashable a) => Fold a (HashSet.HashSet a)
+hashSet = Fold (flip HashSet.insert) HashSet.empty id
+{-# INLINABLE hashSet #-}
+
+{-|
+Fold pairs into a map.
+-}
+map :: Ord a => Fold (a, b) (Map.Map a b)
+map = Fold step begin done
+  where
+    begin = mempty
+    step m (k, v) = Map.insert k v m
+    done = id
+{-# INLINABLE map #-}
+
+{-|
+Fold pairs into a hash-map.
+-}
+hashMap :: (Eq a, Hashable a) => Fold (a, b) (HashMap.HashMap a b)
+hashMap = Fold step begin done
+  where
+    begin = mempty
+    step m (k, v) = HashMap.insert k v m
+    done = id
+{-# INLINABLE hashMap #-}
+
 maxChunkSize :: Int
 maxChunkSize = 8 * 1024 * 1024
 


Reply via email to