groups-generic-0.2.0.0: Generically derive Group instances.
Safe HaskellNone
LanguageHaskell2010

Data.Group.Generics

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 #

(~~) :: Par1 g -> Par1 g -> Par1 g #

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

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

(Generic g, Monoid (GenericProduct g), Group (Rep g ())) => Group (GenericProduct g) 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 #

(~~) :: U1 p -> U1 p -> U1 p #

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

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

Methods

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

(~~) :: Rec1 f p -> Rec1 f p -> Rec1 f p #

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

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

Methods

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

(~~) :: K1 i g p -> K1 i g p -> K1 i g p #

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

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

Methods

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

(~~) :: M1 i c f p -> M1 i c f p -> M1 i c f p #

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