Hello community,

here is the log from the commit of package ghc-extra for openSUSE:Factory 
checked in at 2020-09-27 11:48:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-extra (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-extra.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-extra"

Sun Sep 27 11:48:53 2020 rev:30 rq:835598 version:1.7.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-extra/ghc-extra.changes      2020-09-07 
21:22:53.125037194 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-extra.new.4249/ghc-extra.changes    
2020-09-27 11:48:57.947991043 +0200
@@ -1,0 +2,7 @@
+Sat Sep 12 16:17:48 UTC 2020 - [email protected]
+
+- Update extra to version 1.7.8.
+  1.7.8, released 2020-09-12
+      #68, make sure Data.Foldable.Extra is exposed
+
+-------------------------------------------------------------------

Old:
----
  extra-1.7.7.tar.gz

New:
----
  extra-1.7.8.tar.gz

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

Other differences:
------------------
++++++ ghc-extra.spec ++++++
--- /var/tmp/diff_new_pack.bRqwVQ/_old  2020-09-27 11:48:58.599991746 +0200
+++ /var/tmp/diff_new_pack.bRqwVQ/_new  2020-09-27 11:48:58.599991746 +0200
@@ -19,7 +19,7 @@
 %global pkg_name extra
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.7.7
+Version:        1.7.8
 Release:        0
 Summary:        Extra functions I use
 License:        BSD-3-Clause

++++++ extra-1.7.7.tar.gz -> extra-1.7.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/extra-1.7.7/CHANGES.txt new/extra-1.7.8/CHANGES.txt
--- old/extra-1.7.7/CHANGES.txt 2020-08-25 22:12:34.000000000 +0200
+++ new/extra-1.7.8/CHANGES.txt 2020-09-12 15:00:17.000000000 +0200
@@ -1,5 +1,7 @@
 Changelog for Extra
 
+1.7.8, released 2020-09-12
+    #68, make sure Data.Foldable.Extra is exposed
 1.7.7, released 2020-08-25
     #67, defer to System.IO readFile', hGetContents' in GHC 9.0
 1.7.6, released 2020-08-21
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/extra-1.7.7/Generate.hs new/extra-1.7.8/Generate.hs
--- old/extra-1.7.7/Generate.hs 2020-08-12 10:14:32.000000000 +0200
+++ new/extra-1.7.8/Generate.hs 2020-09-12 14:06:51.000000000 +0200
@@ -19,7 +19,7 @@
 main = do
     src <- readFile "extra.cabal"
     let mods = filter (isSuffixOf ".Extra") $ map trim $ lines src
-    ifaces <- forM mods $ \mod -> do
+    ifaces <- forM (mods \\ exclude) $ \mod -> do
         src <- readFile $ joinPath ("src" : split (== '.') mod) <.> "hs"
         let funcs = filter validIdentifier $ takeWhile (/= "where") $
                     words $ replace "," " " $ drop1 $ dropWhile (/= '(') $
@@ -69,10 +69,12 @@
     when (Just x /= old) $
         writeFileBinary file x
 
+exclude :: [String]
+exclude = ["Data.Foldable.Extra"] -- because all their imports clash
+
 hidden :: String -> [String]
-hidden "Data.List.NonEmpty.Extra" = [ "cons", "snoc", "sortOn", "union", 
"unionBy"
-                                    , "nubOrd", "nubOrdBy", "nubOrdOn"
-                                    ]
+hidden "Data.List.NonEmpty.Extra" = words
+    "cons snoc sortOn union unionBy nubOrd nubOrdBy nubOrdOn"
 hidden _ = []
 
 notHidden :: String -> String -> Bool
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/extra-1.7.7/extra.cabal new/extra-1.7.8/extra.cabal
--- old/extra-1.7.7/extra.cabal 2020-08-25 22:13:22.000000000 +0200
+++ new/extra-1.7.8/extra.cabal 2020-09-12 15:00:02.000000000 +0200
@@ -1,7 +1,7 @@
 cabal-version:      >= 1.18
 build-type:         Simple
 name:               extra
-version:            1.7.7
+version:            1.7.8
 license:            BSD3
 license-file:       LICENSE
 category:           Development
@@ -47,6 +47,7 @@
         Control.Concurrent.Extra
         Control.Exception.Extra
         Control.Monad.Extra
+        Data.Foldable.Extra
         Data.Either.Extra
         Data.IORef.Extra
         Data.List.Extra
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/extra-1.7.7/src/Data/Foldable/Extra.hs 
new/extra-1.7.8/src/Data/Foldable/Extra.hs
--- old/extra-1.7.7/src/Data/Foldable/Extra.hs  1970-01-01 01:00:00.000000000 
+0100
+++ new/extra-1.7.8/src/Data/Foldable/Extra.hs  2020-09-12 14:10:14.000000000 
+0200
@@ -0,0 +1,56 @@
+module Data.Foldable.Extra
+    ( module Data.Foldable
+    , sum'
+    , product'
+    , sumOn'
+    , productOn'
+    , anyM
+    , allM
+    , orM
+    , andM
+    , findM
+    , firstJustM
+    ) where
+
+import Data.Foldable
+import qualified Control.Monad.Extra as MX
+
+-- | A generalization of 'Data.List.Extra.sum'' to 'Foldable' instances.
+sum' :: (Foldable f, Num a) => f a -> a
+sum' = foldl' (+) 0
+
+-- | A generalization of 'Data.List.Extra.product'' to 'Foldable' instances.
+product' :: (Foldable f, Num a) => f a -> a
+product' = foldl' (*) 1
+
+-- | A generalization of 'Data.List.Extra.sumOn'' to 'Foldable' instances.
+sumOn' :: (Foldable f, Num b) => (a -> b) -> f a -> b
+sumOn' f = foldl' (\acc x -> acc + f x) 0
+
+-- | A generalization of 'Data.List.Extra.productOn'' to 'Foldable' instances.
+productOn' :: (Foldable f, Num b) => (a -> b) -> f a -> b
+productOn' f = foldl' (\acc x -> acc * f x) 1
+
+-- | A generalization of 'Control.Monad.Extra.anyM' to 'Foldable' instances. 
Retains the short-circuiting behaviour.
+anyM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool
+anyM p = foldr ((MX.||^) . p) (pure False)
+
+-- | A generalization of 'Control.Monad.Extra.allM' to 'Foldable' instances. 
Retains the short-circuiting behaviour.
+allM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool
+allM p = foldr ((MX.&&^) . p) (pure True)
+
+-- | A generalization of 'Control.Monad.Extra.orM' to 'Foldable' instances. 
Retains the short-circuiting behaviour.
+orM :: (Foldable f, Monad m) => f (m Bool) -> m Bool
+orM = anyM id
+
+-- | A generalization of 'Control.Monad.Extra.andM' to 'Foldable' instances. 
Retains the short-circuiting behaviour.
+andM :: (Foldable f, Monad m) => f (m Bool) -> m Bool
+andM = allM id
+
+-- | A generalization of 'Control.Monad.Extra.findM' to 'Foldable' instances.
+findM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m (Maybe a)
+findM p = foldr (\x -> MX.ifM (p x) (pure $ Just x)) (pure Nothing)
+
+-- | A generalization of 'Control.Monad.Extra.firstJustM' to 'Foldable' 
instances.
+firstJustM :: (Foldable f, Monad m) => (a -> m (Maybe b)) -> f a -> m (Maybe b)
+firstJustM p = MX.firstJustM p . toList


Reply via email to