packages feed

groups 0.5 → 0.5.1

raw patch · 2 files changed

+11/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Group: instance Data.Group.Abelian a => Data.Group.Abelian (Data.Functor.Contravariant.Op a b)
+ Data.Group: instance Data.Group.Group a => Data.Group.Group (Data.Functor.Contravariant.Op a b)
+ Data.Group: instance GHC.Real.Integral a => Data.Group.Cyclic (Data.Semigroup.Internal.Sum a)

Files

groups.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                groups-version:             0.5+version:             0.5.1 synopsis:            Groups description:   A group is a monoid with invertibility.
src/Data/Group.hs view
@@ -14,6 +14,7 @@ import Data.Functor.Identity #endif #if MIN_VERSION_base(4,12,0)+import Data.Functor.Contravariant (Op(Op)) import GHC.Generics #endif @@ -128,6 +129,8 @@ instance Cyclic () where   generator = () +instance Integral a => Cyclic (Sum a) where+  generator = Sum 1 #if MIN_VERSION_base(4,7,0) -- | Trivial group, Functor style. instance Group (Proxy x) where@@ -168,6 +171,7 @@  -- (:*:) and (:.:) exist since base-4.6.0.0 but the Monoid instances -- arrive in base-4.12.0.0.+-- Also, contravariant was moved into base in this version. #if MIN_VERSION_base(4,12,0) -- | Product of groups, Functor style. instance (Group (f a), Group (g a)) => Group ((f :*: g) a) where@@ -184,4 +188,10 @@ instance (Abelian (f a), Abelian (g a)) => Abelian ((f :*: g) a)  instance Abelian (f (g a)) => Abelian ((f :.: g) a)++instance Group a => Group (Op a b) where+  invert (Op f) = Op (invert f)+  pow (Op f) n = Op (\e -> pow (f e) n)++instance Abelian a => Abelian (Op a b) #endif