@@ -61,20 +61,19 @@ instance Additive ()
61instance (Group a, Group b) => Group (a, b) where
61instance (Group a, Group b) => Group (a, b) where
62 negateG (a, b) = (negateG a, negateG b)
62 negateG (a, b) = (negateG a, negateG b)
63 (a, b) ~~ (c, d) = (a ~~ c, b ~~ d)
63 (a, b) ~~ (c, d) = (a ~~ c, b ~~ d)
64−instance (Additive a, Additive b) => Additive (a, b) where
64+instance (Additive a, Additive b) => Additive (a, b)
66-- See https://gitlab.haskell.org/ghc/ghc/issues/11135#note_111802 for the reason Compose is not also provided.
66-- See https://gitlab.haskell.org/ghc/ghc/issues/11135#note_111802 for the reason Compose is not also provided.
67-- Base does not define Monoid (Compose f g a) so this has no "home"
67-- Base does not define Monoid (Compose f g a) so this has no "home"
68instance Group (f (g a)) => Group ((f :.: g) a) where
68instance Group (f (g a)) => Group ((f :.: g) a) where
69 negateG (Comp1 xs) = Comp1 (negateG xs)
69 negateG (Comp1 xs) = Comp1 (negateG xs)
70 Comp1 xs ~~ Comp1 ys = Comp1 (xs ~~ ys)
70 Comp1 xs ~~ Comp1 ys = Comp1 (xs ~~ ys)
72−instance Additive (f (g a)) => Additive ((f :.: g) a) where
71+instance Additive (f (g a)) => Additive ((f :.: g) a)
74instance (Group (f a), Group (g a)) => Group ((f :*: g) a) where
73instance (Group (f a), Group (g a)) => Group ((f :*: g) a) where
75 negateG (a :*: b) = negateG a :*: negateG b
74 negateG (a :*: b) = negateG a :*: negateG b
76 (a :*: b) ~~ (c :*: d) = (a ~~ c :*: b ~~ d)
75 (a :*: b) ~~ (c :*: d) = (a ~~ c :*: b ~~ d)
77−instance (Additive (f a), Additive (g a)) => Additive ((f :*: g) a) where
76+instance (Additive (f a), Additive (g a)) => Additive ((f :*: g) a)
79instance Group (Proxy x) where
78instance Group (Proxy x) where
80 negateG _ = Proxy
79 negateG _ = Proxy
@@ -82,7 +81,9 @@ instance Group (Proxy x) where
82instance Additive (Proxy x)
81instance Additive (Proxy x)
84deriving instance Group a => Group (Const a x)
83deriving instance Group a => Group (Const a x)
84+instance Additive a => Additive (Const a x)
85deriving instance Group a => Group (Identity a)
85deriving instance Group a => Group (Identity a)
86+instance Additive a => Additive (Identity a)
87instance Group b => Group (a -> b) where
88instance Group b => Group (a -> b) where
88 negateG f = negateG . f
89 negateG f = negateG . f