commit ghc-foldl for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-foldl for openSUSE:Factory checked in at 2020-09-30 19:53:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-foldl (Old) and /work/SRC/openSUSE:Factory/.ghc-foldl.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-foldl" Wed Sep 30 19:53:29 2020 rev:14 rq:838493 version:1.4.9 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-foldl/ghc-foldl.changes 2020-09-07 22:02:07.370071480 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-foldl.new.4249/ghc-foldl.changes 2020-09-30 19:53:35.676741970 +0200 @@ -1,0 +2,8 @@ +Mon Sep 28 02:01:38 UTC 2020 - psimons@suse.com + +- Update foldl to version 1.4.9. + 1.4.9 + + * Implement `vector` utility more efficiently + +------------------------------------------------------------------- Old: ---- foldl-1.4.8.tar.gz foldl.cabal New: ---- foldl-1.4.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-foldl.spec ++++++ --- /var/tmp/diff_new_pack.BUqOfY/_old 2020-09-30 19:53:36.248742482 +0200 +++ /var/tmp/diff_new_pack.BUqOfY/_new 2020-09-30 19:53:36.248742482 +0200 @@ -19,13 +19,12 @@ %global pkg_name foldl %bcond_with tests Name: ghc-%{pkg_name} -Version: 1.4.8 +Version: 1.4.9 Release: 0 Summary: Composable, streaming, and efficient left folds License: BSD-3-Clause 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 BuildRequires: ghc-bytestring-devel BuildRequires: ghc-comonad-devel @@ -40,7 +39,6 @@ BuildRequires: ghc-text-devel BuildRequires: ghc-transformers-devel BuildRequires: ghc-unordered-containers-devel -BuildRequires: ghc-vector-builder-devel BuildRequires: ghc-vector-devel %if %{with tests} BuildRequires: ghc-doctest-devel @@ -64,7 +62,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ foldl-1.4.8.tar.gz -> foldl-1.4.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.8/CHANGELOG.md new/foldl-1.4.9/CHANGELOG.md --- old/foldl-1.4.8/CHANGELOG.md 2020-08-02 20:04:12.000000000 +0200 +++ new/foldl-1.4.9/CHANGELOG.md 2020-09-28 03:43:47.000000000 +0200 @@ -1,3 +1,7 @@ +1.4.9 + +* Implement `vector` utility more efficiently + 1.4.8 * Only depend on `semigroups` for older GHC versions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.8/foldl.cabal new/foldl-1.4.9/foldl.cabal --- old/foldl-1.4.8/foldl.cabal 2020-08-02 20:04:12.000000000 +0200 +++ new/foldl-1.4.9/foldl.cabal 2020-09-28 03:43:47.000000000 +0200 @@ -1,5 +1,5 @@ Name: foldl -Version: 1.4.8 +Version: 1.4.9 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3 @@ -26,7 +26,7 @@ Build-Depends: base >= 4.8 && < 5 , bytestring >= 0.9.2.1 && < 0.11, - mwc-random >= 0.13.1.0 && < 0.15, + mwc-random >= 0.13.1.0 && < 0.16, primitive < 0.8 , text >= 0.11.2.0 && < 1.3 , transformers >= 0.2.0.0 && < 0.6 , @@ -37,8 +37,7 @@ contravariant < 1.6 , profunctors < 5.6 , semigroupoids >= 1.0 && < 5.4 , - comonad >= 4.0 && < 6 , - vector-builder < 0.4 + comonad >= 4.0 && < 6 if impl(ghc < 8.0) Build-Depends: semigroups >= 0.17 && < 1.20 @@ -50,6 +49,8 @@ Other-Modules: Control.Foldl.Optics Control.Foldl.Internal + Control.Foldl.Util.Vector + Control.Foldl.Util.MVector GHC-Options: -O2 -Wall Default-Language: Haskell2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.8/src/Control/Foldl/Util/MVector.hs new/foldl-1.4.9/src/Control/Foldl/Util/MVector.hs --- old/foldl-1.4.8/src/Control/Foldl/Util/MVector.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/foldl-1.4.9/src/Control/Foldl/Util/MVector.hs 2020-09-28 03:43:47.000000000 +0200 @@ -0,0 +1,17 @@ +{-# LANGUAGE BangPatterns #-} +module Control.Foldl.Util.MVector +where + +import Data.Vector.Generic.Mutable +import Control.Monad.ST + + +{-# INLINE writeListInReverseOrderStartingFrom #-} +writeListInReverseOrderStartingFrom :: MVector v a => v s a -> Int -> [a] -> ST s () +writeListInReverseOrderStartingFrom v = let + loop !index list = case list of + h : t -> do + unsafeWrite v index h + loop (pred index) t + _ -> return () + in loop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.8/src/Control/Foldl/Util/Vector.hs new/foldl-1.4.9/src/Control/Foldl/Util/Vector.hs --- old/foldl-1.4.8/src/Control/Foldl/Util/Vector.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/foldl-1.4.9/src/Control/Foldl/Util/Vector.hs 2020-09-28 03:43:47.000000000 +0200 @@ -0,0 +1,27 @@ +{-| +General utilities for immutable vectors. +-} +{-# LANGUAGE RankNTypes #-} +module Control.Foldl.Util.Vector where + +import Data.Vector.Generic +import Control.Monad.ST +import qualified Data.Vector.Generic.Mutable as M +import qualified Control.Foldl.Util.MVector as M + + +{-| +>>> fromReverseListN 3 [1,2,3] :: Data.Vector.Vector Int +[3,2,1] +-} +{-# INLINE fromReverseListN #-} +fromReverseListN :: Vector v a => Int -> [a] -> v a +fromReverseListN size list = + initialized size $ \ mv -> M.writeListInReverseOrderStartingFrom mv (pred size) list + +{-# INLINE initialized #-} +initialized :: Vector v a => Int -> (forall s. Mutable v s a -> ST s ()) -> v a +initialized size initialize = runST $ do + mv <- M.unsafeNew size + initialize mv + unsafeFreeze mv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/foldl-1.4.8/src/Control/Foldl.hs new/foldl-1.4.9/src/Control/Foldl.hs --- old/foldl-1.4.8/src/Control/Foldl.hs 2020-08-02 20:04:12.000000000 +0200 +++ new/foldl-1.4.9/src/Control/Foldl.hs 2020-09-28 03:43:47.000000000 +0200 @@ -197,9 +197,8 @@ import qualified Data.HashMap.Strict as HashMap import qualified Data.HashSet as HashSet import qualified Data.Vector.Generic as V +import qualified Control.Foldl.Util.Vector as V import qualified Data.Vector.Generic.Mutable as M -import qualified VectorBuilder.Builder -import qualified VectorBuilder.Vector import qualified Data.Semigroupoid {- $setup @@ -1000,13 +999,7 @@ -- | Fold all values into a vector vector :: Vector v a => Fold a (v a) -vector = Fold step begin done - where - begin = VectorBuilder.Builder.empty - - step x a = x <> VectorBuilder.Builder.singleton a - - done = VectorBuilder.Vector.build +vector = V.fromReverseListN <$> length <*> revList {-# INLINABLE vector #-} maxChunkSize :: Int
participants (1)
-
root