Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-invariant for openSUSE:Factory checked in at 2022-08-01 21:31:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-invariant (Old)
and /work/SRC/openSUSE:Factory/.ghc-invariant.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-invariant"
Mon Aug 1 21:31:22 2022 rev:13 rq:988215 version:0.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-invariant/ghc-invariant.changes 2021-11-11 21:36:53.508909210 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-invariant.new.1533/ghc-invariant.changes 2022-08-01 21:32:09.953960621 +0200
@@ -1,0 +2,24 @@
+Sun Jul 3 10:17:11 UTC 2022 - Peter Simons <psimons(a)suse.com>
+
+- Update invariant to version 0.6.
+ # 0.6 [2022.07.03]
+ * Loosen the `Monad` constraint in the `Invariant(2)` instances for
+ `Kleisli` to an `Invariant` constraint.
+ * Loosen the `Comonad` constraint in the `Invariant2` instance for `Cokleisli`
+ to an `Invariant` constraint.
+ * Add `Invariant` instances for `PastroSum`, `CopastroSum`, `Environment`,
+ `FreeMapping`, `Pastro`, and `FreeTraversing` from the `profunctors` library.
+ * Add `Invariant(2)` instances for `Copastro` and `Coyoneda` from the
+ `profunctors` library.
+
+-------------------------------------------------------------------
+Sat May 7 23:56:16 UTC 2022 - Peter Simons <psimons(a)suse.com>
+
+- Update invariant to version 0.5.6.
+ # 0.5.6 [2022.05.07]
+ * Add `InvariantProfunctor` and `InvariantArrow` newtypes that admit
+ implementations of `invmap` that only require `Profunctor` or `Arrow`
+ constraints, respectively. Also add top-level `invmapProfunctor` and
+ `invmapArrow` functions.
+
+-------------------------------------------------------------------
Old:
----
invariant-0.5.5.tar.gz
New:
----
invariant-0.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-invariant.spec ++++++
--- /var/tmp/diff_new_pack.L1Z7W6/_old 2022-08-01 21:32:10.489962158 +0200
+++ /var/tmp/diff_new_pack.L1Z7W6/_new 2022-08-01 21:32:10.497962182 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-invariant
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name invariant
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.5.5
+Version: 0.6
Release: 0
Summary: Haskell98 invariant functors
License: BSD-2-Clause
++++++ invariant-0.5.5.tar.gz -> invariant-0.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invariant-0.5.5/CHANGELOG.md new/invariant-0.6/CHANGELOG.md
--- old/invariant-0.5.5/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200
+++ new/invariant-0.6/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200
@@ -1,3 +1,19 @@
+# 0.6 [2022.07.03]
+* Loosen the `Monad` constraint in the `Invariant(2)` instances for
+ `Kleisli` to an `Invariant` constraint.
+* Loosen the `Comonad` constraint in the `Invariant2` instance for `Cokleisli`
+ to an `Invariant` constraint.
+* Add `Invariant` instances for `PastroSum`, `CopastroSum`, `Environment`,
+ `FreeMapping`, `Pastro`, and `FreeTraversing` from the `profunctors` library.
+* Add `Invariant(2)` instances for `Copastro` and `Coyoneda` from the
+ `profunctors` library.
+
+# 0.5.6 [2022.05.07]
+* Add `InvariantProfunctor` and `InvariantArrow` newtypes that admit
+ implementations of `invmap` that only require `Profunctor` or `Arrow`
+ constraints, respectively. Also add top-level `invmapProfunctor` and
+ `invmapArrow` functions.
+
# 0.5.5 [2021.11.01]
* Allow building with GHC 9.2.
* Allow building with `transformers-0.6.*`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invariant-0.5.5/invariant.cabal new/invariant-0.6/invariant.cabal
--- old/invariant-0.5.5/invariant.cabal 2001-09-09 03:46:40.000000000 +0200
+++ new/invariant-0.6/invariant.cabal 2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
name: invariant
-version: 0.5.5
+version: 0.6
synopsis: Haskell98 invariant functors
description: Haskell98 invariant functors (also known as exponential functors).
.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invariant-0.5.5/src/Data/Functor/Invariant.hs new/invariant-0.6/src/Data/Functor/Invariant.hs
--- old/invariant-0.5.5/src/Data/Functor/Invariant.hs 2001-09-09 03:46:40.000000000 +0200
+++ new/invariant-0.6/src/Data/Functor/Invariant.hs 2001-09-09 03:46:40.000000000 +0200
@@ -42,7 +42,11 @@
#endif
, WrappedFunctor(..)
, invmapContravariant
+ , invmapProfunctor
+ , invmapArrow
, WrappedContravariant(..)
+ , InvariantProfunctor(..)
+ , InvariantArrow(..)
-- * @Invariant2@
, Invariant2(..)
, invmap2Bifunctor
@@ -108,7 +112,7 @@
import Data.Bifunctor.Wrapped
-- comonad
-import Control.Comonad (Comonad(..), Cokleisli(..), liftW)
+import Control.Comonad (Cokleisli(..))
-- containers
import Data.IntMap (IntMap)
@@ -195,6 +199,14 @@
invmapContravariant :: Contravariant f => (a -> b) -> (b -> a) -> f a -> f b
invmapContravariant = const contramap
+-- | A 'Profunctor' with the same input and output types can be seen as an 'Invariant' functor.
+invmapProfunctor :: Profunctor p => (a -> b) -> (b -> a) -> p a a -> p b b
+invmapProfunctor = flip dimap
+
+-- | An 'Arrow' with the same input and output types can be seen as an 'Invariant' functor.
+invmapArrow :: Arrow arr => (a -> b) -> (b -> a) -> arr a a -> arr b b
+invmapArrow fn1 fn2 arrow = arr fn1 Cat.. arrow Cat.. arr fn2
+
-------------------------------------------------------------------------------
-- Invariant instances
-------------------------------------------------------------------------------
@@ -235,8 +247,8 @@
=> Invariant (ArrowMonad a) where
invmap f _ (ArrowMonad m) = ArrowMonad (m >>> arr f)
-- | from "Control.Arrow"
-instance Monad m => Invariant (Kleisli m a) where
- invmap = invmap2 id id
+instance Invariant m => Invariant (Kleisli m a) where
+ invmap f g (Kleisli m) = Kleisli (invmap f g . m)
-- | from "Control.Exception"
instance Invariant Handler where
@@ -424,6 +436,9 @@
instance Invariant2 p => Invariant (Closure p a) where
invmap = invmap2 id id
-- | from the @profunctors@ package
+instance Invariant (Environment p a) where
+ invmap = invmap2 id id
+-- | from the @profunctors@ package
instance Invariant2 p => Invariant (Codensity p a) where
invmap = invmap2 id id
-- | from the @profunctors@ package
@@ -445,9 +460,27 @@
instance Invariant2 p => Invariant (Tambara p a) where
invmap = invmap2 id id
-- | from the @profunctors@ package
+instance Invariant (PastroSum p a) where
+ invmap = invmap2 id id
+-- | from the @profunctors@ package
+instance Invariant (FreeMapping p a) where
+ invmap = invmap2 id id
+-- | from the @profunctors@ package
+instance Invariant (FreeTraversing p a) where
+ invmap = invmap2 id id
+-- | from the @profunctors@ package
+instance Invariant (Pastro p a) where
+ invmap = invmap2 id id
+-- | from the @profunctors@ package
instance Invariant (Cotambara p a) where
invmap = invmapFunctor
-- | from the @profunctors@ package
+instance Invariant (Copastro p a) where
+ invmap = invmap2 id id
+-- | from the @profunctors@ package
+instance Invariant (CopastroSum p a) where
+ invmap = invmap2 id id
+-- | from the @profunctors@ package
instance Invariant (CotambaraSum p a) where
invmap = invmapFunctor
-- | from the @profunctors@ package
@@ -456,6 +489,9 @@
-- | from the @profunctors@ package
instance Invariant (Yoneda p a) where
invmap = invmapFunctor
+-- | from the @profunctors@ package
+instance Invariant (Coyoneda p a) where
+ invmap = invmap2 id id
-- | from the @StateVar@ package
instance Invariant StateVar where
@@ -690,8 +726,8 @@
invmap2 _ f' g _ (App.WrapArrow x) = App.WrapArrow $ arr g Cat.. x Cat.. arr f'
-- | from "Control.Arrow"
-instance Monad m => Invariant2 (Kleisli m) where
- invmap2 _ f' g _ (Kleisli m) = Kleisli $ liftM g . m . f'
+instance Invariant m => Invariant2 (Kleisli m) where
+ invmap2 _ f' g g' (Kleisli m) = Kleisli $ invmap g g' . m . f'
-- | from "Data.Semigroup"
instance Invariant2 Arg where
@@ -727,9 +763,8 @@
invmap2 = invmap2Bifunctor
-- | from the @comonad@ package
-instance Comonad w => Invariant2 (Cokleisli w) where
- invmap2 _ f' g _ (Cokleisli w) = Cokleisli $ g . w . liftW f'
-
+instance Invariant w => Invariant2 (Cokleisli w) where
+ invmap2 f f' g _ (Cokleisli w) = Cokleisli $ g . w . invmap f' f
-- | from the @contravariant@ package
instance Invariant2 Op where
invmap2 f f' g g' (Op x) = Op $ invmap2 g g' f f' x
@@ -798,6 +833,9 @@
instance Invariant2 (Cotambara p) where
invmap2 = invmap2Profunctor
-- | from the @profunctors@ package
+instance Invariant2 (Copastro p) where
+ invmap2 = invmap2Profunctor
+-- | from the @profunctors@ package
instance Invariant2 (CopastroSum p) where
invmap2 = invmap2Profunctor
-- | from the @profunctors@ package
@@ -810,6 +848,9 @@
-- | from the @profunctors@ package
instance Invariant2 (Yoneda p) where
invmap2 = invmap2Profunctor
+-- | from the @profunctors@ package
+instance Invariant2 (Coyoneda p) where
+ invmap2 = invmap2Profunctor
-- | from the @tagged@ package
instance Invariant2 Tagged where
@@ -986,3 +1027,19 @@
genericInvmap :: (Generic1 f, Invariant (Rep1 f)) => (a -> b) -> (b -> a) -> f a -> f b
genericInvmap f g = to1 . invmap f g . from1
#endif
+
+-------------------------------------------------------------------------------
+-- Wrappers
+-------------------------------------------------------------------------------
+
+-- | A 'Profunctor' with the same input and output types can be seen as an 'Invariant' functor.
+newtype InvariantProfunctor p a = InvariantProfunctor (p a a)
+
+instance Profunctor p => Invariant (InvariantProfunctor p) where
+ invmap fn1 fn2 (InvariantProfunctor f) = InvariantProfunctor (invmapProfunctor fn1 fn2 f)
+
+-- | An 'Arrow' with the same input and output types can be seen as an 'Invariant' functor.
+newtype InvariantArrow c a = InvariantArrow (c a a)
+
+instance Arrow c => Invariant (InvariantArrow c) where
+ invmap fn1 fn2 (InvariantArrow arrow) = InvariantArrow (invmapArrow fn1 fn2 arrow)