groups-generic-0.1.0.0: Generically derive Group instances.

Safe HaskellNone
LanguageHaskell2010

Data.Group.Generics

Contents

Description

Orphan instances allowing generic deriving of Group instances:

> data MyRecord
>   = MyRecord
>   { field1 :: Sum Double
>   , field2 :: Product Double
>   , field3 :: ( Sum Int, Sum Int )
>   }
>   deriving Generic
>   deriving ( Semigroup, Monoid, Group )
>     via GenericProduct MyRecord

Also includes some instances for newtypes from base such as Identity and Const.

Orphan instances

Group g => Group (Par1 g) Source # 
Instance details

Methods

invert :: Par1 g -> Par1 g #

pow :: Integral x => Par1 g -> x -> Par1 g #

Group a => Group (Identity a) Source # 
Instance details

Methods

invert :: Identity a -> Identity a #

pow :: Integral x => Identity a -> x -> Identity a #

Group a => Group (Down a) Source # 
Instance details

Methods

invert :: Down a -> Down a #

pow :: Integral x => Down a -> x -> Down a #

(Generic g, Semigroup g, Monoid (Generically g), Group (Rep g ())) => Group (Generically g) Source # 
Instance details

Methods

invert :: Generically g -> Generically g #

pow :: Integral x => Generically g -> x -> Generically g #

(Generic g, Monoid (GenericProduct g), Group (Rep g ())) => Group (GenericProduct g) Source # 
Instance details

Abelian g => Abelian (Par1 g) Source # 
Instance details

Abelian a => Abelian (Identity a) Source # 
Instance details

Abelian a => Abelian (Down a) Source # 
Instance details

(Generic g, Semigroup g, Monoid (Generically g), Abelian (Rep g ())) => Abelian (Generically g) Source # 
Instance details

(Generic g, Monoid (GenericProduct g), Abelian (Rep g ())) => Abelian (GenericProduct g) Source # 
Instance details

Group (U1 p) Source # 
Instance details

Methods

invert :: U1 p -> U1 p #

pow :: Integral x => U1 p -> x -> U1 p #

Group (Proxy s) Source # 
Instance details

Methods

invert :: Proxy s -> Proxy s #

pow :: Integral x => Proxy s -> x -> Proxy s #

Abelian (U1 p) Source # 
Instance details

Abelian (Proxy s) Source # 
Instance details

Group (f p) => Group (Rec1 f p) Source # 
Instance details

Methods

invert :: Rec1 f p -> Rec1 f p #

pow :: Integral x => Rec1 f p -> x -> Rec1 f p #

Group a => Group (Const a b) Source # 
Instance details

Methods

invert :: Const a b -> Const a b #

pow :: Integral x => Const a b -> x -> Const a b #

Abelian (f p) => Abelian (Rec1 f p) Source # 
Instance details

Abelian a => Abelian (Const a b) Source # 
Instance details

Group g => Group (K1 i g p) Source # 
Instance details

Methods

invert :: K1 i g p -> K1 i g p #

pow :: Integral x => K1 i g p -> x -> K1 i g p #

(Group (f1 p), Group (f2 p)) => Group ((f1 :*: f2) p) Source # 
Instance details

Methods

invert :: (f1 :*: f2) p -> (f1 :*: f2) p #

pow :: Integral x => (f1 :*: f2) p -> x -> (f1 :*: f2) p #

Abelian g => Abelian (K1 i g p) Source # 
Instance details

(Abelian (f1 p), Abelian (f2 p)) => Abelian ((f1 :*: f2) p) Source # 
Instance details

Group (f p) => Group (M1 i c f p) Source # 
Instance details

Methods

invert :: M1 i c f p -> M1 i c f p #

pow :: Integral x => M1 i c f p -> x -> M1 i c f p #

Group (f (g p)) => Group ((f :.: g) p) Source # 
Instance details

Methods

invert :: (f :.: g) p -> (f :.: g) p #

pow :: Integral x => (f :.: g) p -> x -> (f :.: g) p #

Abelian (f p) => Abelian (M1 i c f p) Source # 
Instance details

Abelian (f (g p)) => Abelian ((f :.: g) p) Source # 
Instance details