Hello community, here is the log from the commit of package ghc-foldl for openSUSE:Factory checked in at 2018-10-25 08:16:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-foldl (Old) and /work/SRC/openSUSE:Factory/.ghc-foldl.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-foldl" Thu Oct 25 08:16:10 2018 rev:3 rq:642858 version:1.4.5 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-foldl/ghc-foldl.changes 2018-08-20 16:20:12.820889643 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-foldl.new/ghc-foldl.changes 2018-10-25 08:17:11.860048283 +0200 @@ -1,0 +2,14 @@ +Thu Oct 4 09:42:54 UTC 2018 - [email protected] + +- Update foldl to version 1.4.5. + 1.4.5 + + * Increase upper bound on `containers` + * Add `either`/`eitherM` + + 1.4.4 + + * Increase lower bound on `base` + * Change `mean` to be more numerically stable + +------------------------------------------------------------------- Old: ---- foldl-1.4.3.tar.gz New: ---- foldl-1.4.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-foldl.spec ++++++ --- /var/tmp/diff_new_pack.6HFh64/_old 2018-10-25 08:17:12.532047990 +0200 +++ /var/tmp/diff_new_pack.6HFh64/_new 2018-10-25 08:17:12.536047989 +0200 @@ -12,13 +12,13 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global pkg_name foldl Name: ghc-%{pkg_name} -Version: 1.4.3 +Version: 1.4.5 Release: 0 Summary: Composable, streaming, and efficient left folds License: BSD-3-Clause ++++++ foldl-1.4.3.tar.gz -> foldl-1.4.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.3/CHANGELOG.md new/foldl-1.4.5/CHANGELOG.md --- old/foldl-1.4.3/CHANGELOG.md 2018-08-04 17:04:07.000000000 +0200 +++ new/foldl-1.4.5/CHANGELOG.md 2018-10-04 01:13:02.000000000 +0200 @@ -1,3 +1,13 @@ +1.4.5 + +* Increase upper bound on `containers` +* Add `either`/`eitherM` + +1.4.4 + +* Increase lower bound on `base` +* Change `mean` to be more numerically stable + 1.4.3 * Add `Control.Scanl.scanr` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.3/README.md new/foldl-1.4.5/README.md --- old/foldl-1.4.3/README.md 2018-08-04 17:04:07.000000000 +0200 +++ new/foldl-1.4.5/README.md 2018-10-04 01:13:02.000000000 +0200 @@ -1,4 +1,4 @@ -# `foldl` v1.4.3 +# `foldl` v1.4.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.4.3/foldl.cabal new/foldl-1.4.5/foldl.cabal --- old/foldl-1.4.3/foldl.cabal 2018-08-04 17:04:07.000000000 +0200 +++ new/foldl-1.4.5/foldl.cabal 2018-10-04 01:13:02.000000000 +0200 @@ -1,5 +1,5 @@ Name: foldl -Version: 1.4.3 +Version: 1.4.5 Cabal-Version: >=1.8.0.2 Build-Type: Simple License: BSD3 @@ -24,14 +24,14 @@ Library HS-Source-Dirs: src Build-Depends: - base >= 4.5 && < 5 , + base >= 4.8 && < 5 , bytestring >= 0.9.2.1 && < 0.11, mwc-random >= 0.13.1.0 && < 0.15, primitive < 0.7 , text >= 0.11.2.0 && < 1.3 , transformers >= 0.2.0.0 && < 0.6 , vector >= 0.7 && < 0.13, - containers >= 0.5.0.0 && < 0.6 , + containers >= 0.5.0.0 && < 0.7 , unordered-containers < 0.3 , hashable < 1.3 , contravariant < 1.6 , @@ -46,6 +46,7 @@ Control.Foldl.Text, Control.Scanl Other-Modules: + Control.Foldl.Optics Control.Foldl.Internal GHC-Options: -O2 -Wall diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.3/src/Control/Foldl/Optics.hs new/foldl-1.4.5/src/Control/Foldl/Optics.hs --- old/foldl-1.4.3/src/Control/Foldl/Optics.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/foldl-1.4.5/src/Control/Foldl/Optics.hs 2018-10-04 01:13:02.000000000 +0200 @@ -0,0 +1,21 @@ +{-# LANGUAGE RankNTypes #-} +module Control.Foldl.Optics where + +import Data.Profunctor +import Control.Applicative + +type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t) + +type Prism' s a = Prism s s a a + +prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b +prism bt seta = dimap seta (either pure (fmap bt)) . right' +{-# INLINE prism #-} + +_Left :: Prism (Either a c) (Either b c) a b +_Left = prism Left $ either Right (Left . Right) +{-# INLINE _Left #-} + +_Right :: Prism (Either c a) (Either c b) a b +_Right = prism Right $ either (Left . Left) Right +{-# INLINE _Right #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.3/src/Control/Foldl.hs new/foldl-1.4.5/src/Control/Foldl.hs --- old/foldl-1.4.3/src/Control/Foldl.hs 2018-08-04 17:04:07.000000000 +0200 +++ new/foldl-1.4.5/src/Control/Foldl.hs 2018-10-04 01:13:02.000000000 +0200 @@ -128,6 +128,8 @@ , folded , filtered , groupBy + , either + , eitherM -- * Re-exports -- $reexports @@ -136,6 +138,7 @@ , module Data.Vector.Generic ) where +import Control.Foldl.Optics (_Left, _Right) import Control.Applicative import Control.Foldl.Internal (Maybe'(..), lazy, Either'(..), Pair(..), hush) import Control.Monad ((<=<)) @@ -173,6 +176,7 @@ , notElem , lookup , map + , either ) import qualified Data.Foldable as F @@ -626,7 +630,7 @@ mean = Fold step begin done where begin = Pair 0 0 - step (Pair x n) y = Pair ((x * n + y) / (n + 1)) (n + 1) + step (Pair x n) y = let n' = n+1 in Pair (x + (y - x) /n') n' done (Pair x _) = x {-# INLINABLE mean #-} @@ -1324,6 +1328,18 @@ f' !m !a = alter (\o -> Just (f (fromMaybe i o) a)) (grouper a) m {-# INLINABLE groupBy #-} +{-| Combine two folds into a fold over inputs for either of them. +-} +either :: Fold a1 b1 -> Fold a2 b2 -> Fold (Either a1 a2) (b1, b2) +either l r = (,) <$> handles _Left l <*> handles _Right r +{-# INLINABLE either #-} + +{-| Combine two monadic folds into a fold over inputs for either of them. +-} +eitherM :: Monad m => FoldM m a1 b1 -> FoldM m a2 b2 -> FoldM m (Either a1 a2) (b1, b2) +eitherM l r = (,) <$> handlesM _Left l <*> handlesM _Right r +{-# INLINABLE eitherM #-} + {- $reexports @Control.Monad.Primitive@ re-exports the 'PrimMonad' type class
