Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-semialign for openSUSE:Factory 
checked in at 2021-03-10 08:55:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-semialign (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-semialign.new.2378 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-semialign"

Wed Mar 10 08:55:33 2021 rev:3 rq:877671 version:1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-semialign/ghc-semialign.changes      
2020-12-22 11:45:50.453832690 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-semialign.new.2378/ghc-semialign.changes    
2021-03-10 08:57:35.602909921 +0100
@@ -1,0 +2,11 @@
+Thu Feb 25 23:48:25 UTC 2021 - psim...@suse.com
+
+- Update semialign to version 1.2.
+  # 1.2
+
+  - Migrate `SemialignWithIndex` and `ZipWithIndex` to this package,
+    using `FunctorWithIndex` from `indexed-traversable`.
+  - Add `RepeatWithIndex` type-class.
+  - Poly-kinded instances (notably `Tagged`)
+
+-------------------------------------------------------------------

Old:
----
  semialign-1.1.0.1.tar.gz

New:
----
  semialign-1.2.tar.gz

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

Other differences:
------------------
++++++ ghc-semialign.spec ++++++
--- /var/tmp/diff_new_pack.6Iht0T/_old  2021-03-10 08:57:36.050910384 +0100
+++ /var/tmp/diff_new_pack.6Iht0T/_new  2021-03-10 08:57:36.054910387 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-semialign
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %global pkg_name semialign
 Name:           ghc-%{pkg_name}
-Version:        1.1.0.1
+Version:        1.2
 Release:        0
 Summary:        Align and Zip type-classes from the common Semialign ancestor
 License:        BSD-3-Clause
@@ -27,6 +27,8 @@
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-indexed-traversable-devel
+BuildRequires:  ghc-indexed-traversable-instances-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-tagged-devel

++++++ semialign-1.1.0.1.tar.gz -> semialign-1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/semialign-1.1.0.1/CHANGELOG.md 
new/semialign-1.2/CHANGELOG.md
--- old/semialign-1.1.0.1/CHANGELOG.md  2001-09-09 03:46:40.000000000 +0200
+++ new/semialign-1.2/CHANGELOG.md      2001-09-09 03:46:40.000000000 +0200
@@ -1,3 +1,10 @@
+# 1.2
+
+- Migrate `SemialignWithIndex` and `ZipWithIndex` to this package,
+  using `FunctorWithIndex` from `indexed-traversable`.
+- Add `RepeatWithIndex` type-class.
+- Poly-kinded instances (notably `Tagged`)
+
 # 1.1.0.1
 
 - Drop `base-compat` dependency
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/semialign-1.1.0.1/semialign.cabal 
new/semialign-1.2/semialign.cabal
--- old/semialign-1.1.0.1/semialign.cabal       2001-09-09 03:46:40.000000000 
+0200
+++ new/semialign-1.2/semialign.cabal   2001-09-09 03:46:40.000000000 +0200
@@ -1,10 +1,10 @@
 cabal-version:      >=1.10
 name:               semialign
-version:            1.1.0.1
+version:            1.2
 synopsis:
   Align and Zip type-classes from the common Semialign ancestor.
 
-homepage:           https://github.com/isomorphism/these
+homepage:           https://github.com/haskellari/these
 license:            BSD3
 license-file:       LICENSE
 author:             C. McCann, Oleg Grenrus
@@ -29,13 +29,15 @@
      || ==8.2.2
      || ==8.4.4
      || ==8.6.5
-     || ==8.8.3
-     || ==8.10.1
+     || ==8.8.4
+     || ==8.10.4
+     || ==9.0.1
   , GHCJS ==8.4
 
 source-repository head
   type:     git
-  location: https://github.com/isomorphism/these.git
+  location: https://github.com/haskellari/these.git
+  subdir:   semialign
 
 flag semigroupoids
   description: Build with semigroupoids dependency
@@ -54,25 +56,28 @@
     Data.Align
     Data.Crosswalk
     Data.Semialign
+    Data.Semialign.Indexed
     Data.Zip
 
   other-modules:    Data.Semialign.Internal
 
   -- ghc boot libs
   build-depends:
-      base          >=4.5.1.0 && <4.15
+      base          >=4.5.1.0 && <4.16
     , containers    >=0.4.2.1 && <0.7
     , transformers  >=0.3.0.0 && <0.6
 
   -- These
-  build-depends:    these >=1 && <1.2
+  build-depends:    these >=1.1.1.1 && <1.2
 
   -- other dependencies
   build-depends:
-      hashable              >=1.2.7.0  && <1.4
-    , tagged                >=0.8.6    && <0.9
-    , unordered-containers  >=0.2.8.0  && <0.3
-    , vector                >=0.12.0.2 && <0.13
+      hashable                       >=1.2.7.0  && <1.4
+    , indexed-traversable            >=0.1.1    && <0.2
+    , indexed-traversable-instances  >=0.1      && <0.2
+    , tagged                         >=0.8.6    && <0.9
+    , unordered-containers           >=0.2.8.0  && <0.3
+    , vector                         >=0.12.0.2 && <0.13
 
   -- base shims
   if !impl(ghc >=8.2)
@@ -88,6 +93,9 @@
     if impl(ghc >=7.10)
       build-depends: transformers >=0.4.2.0
 
+  if !impl(ghc >=7.10)
+    build-depends: void >=0.7.3 && <0.8
+
   if impl(ghc <7.5)
     build-depends: ghc-prim
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/semialign-1.1.0.1/src/Data/Semialign/Indexed.hs 
new/semialign-1.2/src/Data/Semialign/Indexed.hs
--- old/semialign-1.1.0.1/src/Data/Semialign/Indexed.hs 1970-01-01 
01:00:00.000000000 +0100
+++ new/semialign-1.2/src/Data/Semialign/Indexed.hs     2001-09-09 
03:46:40.000000000 +0200
@@ -0,0 +1,9 @@
+{-# LANGUAGE Safe #-}
+-- | Zipping and aligning of indexed functors.
+module Data.Semialign.Indexed (
+    SemialignWithIndex (..),
+    ZipWithIndex (..),
+    RepeatWithIndex (..),
+) where
+
+import Data.Semialign.Internal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/semialign-1.1.0.1/src/Data/Semialign/Internal.hs 
new/semialign-1.2/src/Data/Semialign/Internal.hs
--- old/semialign-1.1.0.1/src/Data/Semialign/Internal.hs        2001-09-09 
03:46:40.000000000 +0200
+++ new/semialign-1.2/src/Data/Semialign/Internal.hs    2001-09-09 
03:46:40.000000000 +0200
@@ -1,18 +1,23 @@
 {-# LANGUAGE CPP                        #-}
+{-# LANGUAGE FlexibleInstances          #-}
+{-# LANGUAGE FunctionalDependencies     #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE StandaloneDeriving         #-}
 {-# LANGUAGE Trustworthy                #-}
+{-# LANGUAGE UndecidableInstances       #-}
+#if __GLASGOW_HASKELL__ >= 706
+{-# LANGUAGE PolyKinds                  #-}
+#endif
 module Data.Semialign.Internal where
 
 import Prelude
-       (Bool (..), Eq (..), Functor (fmap), Maybe (..), Monad (..), Ord (..),
-       Ordering (..), String, error, flip, fst, id, maybe, snd, uncurry, ($),
-       (++), (.))
+       (Bool (..), Either (..), Eq (..), Functor (fmap), Int, Maybe (..),
+       Monad (..), Ord (..), Ordering (..), String, error, flip, fst, id,
+       maybe, snd, uncurry, ($), (++), (.))
 
 import qualified Prelude as Prelude
 
-import Control.Applicative (ZipList (..), pure, (<$>))
-import Data.Monoid         (Monoid (..))
+import Control.Applicative               (ZipList (..), pure, (<$>))
 import Data.Bifunctor                    (Bifunctor (..))
 import Data.Functor.Compose              (Compose (..))
 import Data.Functor.Identity             (Identity (..))
@@ -21,12 +26,17 @@
 import Data.HashMap.Strict               (HashMap)
 import Data.List.NonEmpty                (NonEmpty (..))
 import Data.Maybe                        (catMaybes)
+import Data.Monoid                       (Monoid (..))
 import Data.Proxy                        (Proxy (..))
 import Data.Semigroup                    (Option (..), Semigroup (..))
 import Data.Sequence                     (Seq)
 import Data.Tagged                       (Tagged (..))
 import Data.Vector.Fusion.Stream.Monadic (Step (..), Stream (..))
 import Data.Vector.Generic               (Vector, empty, stream, unstream)
+import Data.Void                         (Void)
+
+import Data.Functor.WithIndex           (FunctorWithIndex (imap))
+import Data.Functor.WithIndex.Instances ()
 
 import qualified Data.HashMap.Strict               as HM
 import qualified Data.List.NonEmpty                as NE
@@ -330,6 +340,32 @@
 unzipDefault :: Functor f => f (a, b) -> (f a, f b)
 unzipDefault x = (fst <$> x, snd <$> x)
 
+-- | Indexed version of 'Semialign'.
+--
+-- @since 1.2
+class (FunctorWithIndex i f, Semialign f) => SemialignWithIndex i f | f -> i 
where
+    -- | Analogous to 'alignWith', but also provides an index.
+    ialignWith :: (i -> These a b -> c) -> f a -> f b -> f c
+    ialignWith f a b = imap f (align a b)
+
+-- | Indexed version of 'Zip'.
+--
+-- @since 1.2
+class (SemialignWithIndex i f, Zip f) => ZipWithIndex i f | f -> i where
+    -- | Analogous to 'zipWith', but also provides an index.
+    izipWith :: (i -> a -> b -> c) -> f a -> f b -> f c
+    izipWith f a b = imap (uncurry . f) (zip a b)
+
+-- | Indexed version of 'Repeat'.
+--
+-- @since 1.2
+class (ZipWithIndex i f, Repeat f) => RepeatWithIndex i f | f -> i where
+    -- | Analogous to 'repeat', but also provides an index.
+    --
+    -- This should be the same as 'tabulate' for representable functors.
+    irepeat :: (i -> a) -> f a
+    irepeat f = imap (\i f' -> f' i) (repeat f)
+
 -------------------------------------------------------------------------------
 -- base
 -------------------------------------------------------------------------------
@@ -344,6 +380,13 @@
 instance Repeat ((->) e) where
     repeat = pure
 
+instance SemialignWithIndex e ((->) e) where
+    ialignWith h f g x = h x (These (f x) (g x))
+instance ZipWithIndex e ((->) e) where
+    izipWith h f g x = h x (f x) (g x)
+instance RepeatWithIndex e ((->) e) where
+    irepeat = id
+
 instance Semialign Maybe where
     align Nothing Nothing = Nothing
     align (Just a) Nothing = Just (This a)
@@ -370,6 +413,9 @@
 instance Align Maybe where
     nil = Nothing
 
+instance SemialignWithIndex () Maybe
+instance ZipWithIndex () Maybe
+instance RepeatWithIndex () Maybe
 
 instance Semialign [] where
     align xs [] = This <$> xs
@@ -389,6 +435,9 @@
 instance Unzip [] where
     unzip = Prelude.unzip
 
+instance SemialignWithIndex Int []
+instance ZipWithIndex Int []
+instance RepeatWithIndex Int []
 
 -- | @'zipWith' = 'liftA2'@ .
 instance Semialign ZipList where
@@ -407,6 +456,10 @@
     unzip (ZipList xs) = (ZipList ys, ZipList zs) where
         (ys, zs) = unzip xs
 
+instance SemialignWithIndex Int ZipList
+instance ZipWithIndex Int ZipList
+instance RepeatWithIndex Int ZipList
+
 -------------------------------------------------------------------------------
 -- semigroups
 -------------------------------------------------------------------------------
@@ -424,6 +477,10 @@
 instance Unzip NonEmpty where
     unzip = NE.unzip
 
+instance SemialignWithIndex Int NonEmpty
+instance ZipWithIndex Int NonEmpty
+instance RepeatWithIndex Int NonEmpty
+
 deriving instance Semialign Option
 deriving instance Align Option
 deriving instance Unalign Option
@@ -431,6 +488,12 @@
 deriving instance Repeat Option
 deriving instance Unzip Option
 
+{-
+deriving instance SemialignWithIndex () Option
+deriving instance ZipWithIndex () Option
+deriving instance RepeatWithIndex () Option
+-}
+
 -------------------------------------------------------------------------------
 -- containers: ListLike
 -------------------------------------------------------------------------------
@@ -473,6 +536,9 @@
     zip     = Seq.zip
     zipWith = Seq.zipWith
 
+instance SemialignWithIndex Int Seq
+instance ZipWithIndex Int Seq
+
 instance Semialign T.Tree where
     align (T.Node x xs) (T.Node y ys) = T.Node (These x y) (alignWith (these 
(fmap This) (fmap That) align) xs ys)
 
@@ -540,6 +606,13 @@
 instance Zip IntMap where
     zipWith = IntMap.intersectionWith
 
+instance SemialignWithIndex Int IntMap
+instance ZipWithIndex Int IntMap where
+    izipWith = IntMap.intersectionWithKey
+instance Ord k => SemialignWithIndex k (Map k) where
+instance Ord k => ZipWithIndex k (Map k) where
+    izipWith = Map.intersectionWithKey
+
 -------------------------------------------------------------------------------
 -- transformers
 -------------------------------------------------------------------------------
@@ -556,6 +629,9 @@
 instance Unzip Identity where
     unzip (Identity ~(a, b)) = (Identity a, Identity b)
 
+instance SemialignWithIndex () Identity
+instance ZipWithIndex () Identity
+instance RepeatWithIndex () Identity
 
 instance (Semialign f, Semialign g) => Semialign (Product f g) where
     align (Pair a b) (Pair c d) = Pair (align a c) (align b d)
@@ -581,6 +657,19 @@
         ~(al, ar) = unzip a
         ~(bl, br) = unzip b
 
+instance (SemialignWithIndex i f, SemialignWithIndex j g) => 
SemialignWithIndex (Either i j) (Product f g) where
+    ialignWith f (Pair fa ga) (Pair fb gb) = Pair fc gc where
+        fc = ialignWith (f . Left) fa fb
+        gc = ialignWith (f . Right) ga gb
+
+instance (ZipWithIndex i f, ZipWithIndex j g) => ZipWithIndex (Either i j) 
(Product f g) where
+    izipWith f (Pair fa ga) (Pair fb gb) = Pair fc gc where
+        fc = izipWith (f . Left) fa fb
+        gc = izipWith (f . Right) ga gb
+
+instance (RepeatWithIndex i f, RepeatWithIndex j g) => RepeatWithIndex (Either 
i j) (Product f g) where
+    irepeat f = Pair (irepeat (f . Left)) (irepeat (f . Right))
+
 
 instance (Semialign f, Semialign g) => Semialign (Compose f g) where
     alignWith f (Compose x) (Compose y) = Compose (alignWith g x y) where
@@ -607,6 +696,19 @@
 --     unalignWith f (Compose x) = (Compose y, Compose z) where
 --         ~(y, z) = unalignWith (uncurry These . unalignWith f) x
 
+instance (SemialignWithIndex i f, SemialignWithIndex j g) => 
SemialignWithIndex (i, j) (Compose f g) where
+    ialignWith f (Compose fga) (Compose fgb) = Compose $ ialignWith g fga fgb 
where
+        g i (This ga)     = imap (\j -> f (i, j) . This) ga
+        g i (That gb)     = imap (\j -> f (i, j) . That) gb
+        g i (These ga gb) = ialignWith (\j -> f (i, j)) ga gb
+
+instance (ZipWithIndex i f, ZipWithIndex j g) => ZipWithIndex (i, j) (Compose 
f g) where
+    izipWith f (Compose fga) (Compose fgb) = Compose fgc where
+        fgc = izipWith (\i -> izipWith (\j -> f (i, j))) fga fgb
+
+instance (RepeatWithIndex i f, RepeatWithIndex j g) => RepeatWithIndex (i, j) 
(Compose f g) where
+    irepeat f = Compose (irepeat (\i -> irepeat (\j -> f (i, j))))
+
 -------------------------------------------------------------------------------
 -- vector
 -------------------------------------------------------------------------------
@@ -673,6 +775,10 @@
         => (These a b -> c) -> v a -> v b -> v c
 alignVectorWith f x y = unstream $ alignWith f (stream x) (stream y)
 
+instance SemialignWithIndex Int V.Vector where
+instance ZipWithIndex Int V.Vector where
+    izipWith = V.izipWith
+
 -------------------------------------------------------------------------------
 -- unordered-containers
 -------------------------------------------------------------------------------
@@ -693,6 +799,10 @@
 instance (Eq k, Hashable k) => Unalign (HashMap k) where
     unalign xs = (HM.mapMaybe justHere xs, HM.mapMaybe justThere xs)
 
+instance (Eq k, Hashable k) => SemialignWithIndex k (HashMap k) where
+instance (Eq k, Hashable k) => ZipWithIndex k (HashMap k) where
+    izipWith = HM.intersectionWithKey
+
 -------------------------------------------------------------------------------
 -- tagged
 -------------------------------------------------------------------------------
@@ -709,6 +819,9 @@
 instance Unzip (Tagged b) where
     unzip (Tagged ~(a, b)) = (Tagged a, Tagged b)
 
+instance SemialignWithIndex () (Tagged b)
+instance ZipWithIndex () (Tagged b)
+instance RepeatWithIndex () (Tagged b)
 
 instance Semialign Proxy where
     alignWith _ _ _ = Proxy
@@ -730,6 +843,10 @@
 instance Unzip Proxy where
     unzip _ = (Proxy, Proxy)
 
+instance SemialignWithIndex Void Proxy
+instance ZipWithIndex Void Proxy
+instance RepeatWithIndex Void Proxy
+
 -------------------------------------------------------------------------------
 -- combinators
 -------------------------------------------------------------------------------

Reply via email to