-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Groups
--   
--   A group is a monoid with invertibility.
@package groups
@version 0.5.3

module Data.Group

-- | A Group is a Monoid plus a function, invert, such
--   that:
--   
--   
--   a <> invert a == mempty
--   
--   
--   
--   invert a <> a == mempty
--   
class Monoid m => Group m
invert :: Group m => m -> m

-- | Group subtraction: x ~~ y == x <> invert y
(~~) :: Group m => m -> m -> m

-- | 
--   pow a n == a <> a <> ... <> a
--   
--   
--   
--   (n lots of a)
--   
--   
--   If n is negative, the result is inverted.
pow :: (Group m, Integral x) => m -> x -> m
infixl 7 ~~

-- | An Abelian group is a Group that follows the rule:
--   
--   
--   a <> b == b <> a
--   
class Group g => Abelian g

-- | A Group G is Cyclic if there exists an element x of G
--   such that for all y in G, there exists an n, such that
--   
--   
--   y = pow x n
--   
class Group a => Cyclic a

-- | The generator of the Cyclic group.
generator :: Cyclic a => a

-- | Generate all elements of a Cyclic group using its
--   generator.
--   
--   Note: Fuses, does not terminate even for finite groups.
generated :: Cyclic a => [a]

-- | Lazily generate all elements of a Cyclic group using its
--   generator.
--   
--   Note: Fuses, terminates if the underlying group is finite.
generated' :: (Eq a, Cyclic a) => [a]
instance (Data.Group.Abelian (f a), Data.Group.Abelian (g a)) => Data.Group.Abelian ((GHC.Internal.Generics.:*:) f g a)
instance Data.Group.Abelian (f (g a)) => Data.Group.Abelian ((GHC.Internal.Generics.:.:) f g a)
instance Data.Group.Abelian a => Data.Group.Abelian (GHC.Internal.Data.Functor.Const.Const a x)
instance Data.Group.Abelian a => Data.Group.Abelian (GHC.Internal.Data.Ord.Down a)
instance Data.Group.Abelian a => Data.Group.Abelian (GHC.Internal.Data.Semigroup.Internal.Dual a)
instance Data.Group.Abelian b => Data.Group.Abelian (a -> b)
instance Data.Group.Abelian a => Data.Group.Abelian (GHC.Internal.Data.Functor.Identity.Identity a)
instance Data.Group.Abelian a => Data.Group.Abelian (Data.Functor.Contravariant.Op a b)
instance GHC.Internal.Real.Fractional a => Data.Group.Abelian (GHC.Internal.Data.Semigroup.Internal.Product a)
instance Data.Group.Abelian (GHC.Internal.Data.Proxy.Proxy x)
instance GHC.Internal.Num.Num a => Data.Group.Abelian (GHC.Internal.Data.Semigroup.Internal.Sum a)
instance (Data.Group.Abelian a, Data.Group.Abelian b) => Data.Group.Abelian (a, b)
instance (Data.Group.Abelian a, Data.Group.Abelian b, Data.Group.Abelian c) => Data.Group.Abelian (a, b, c)
instance (Data.Group.Abelian a, Data.Group.Abelian b, Data.Group.Abelian c, Data.Group.Abelian d) => Data.Group.Abelian (a, b, c, d)
instance (Data.Group.Abelian a, Data.Group.Abelian b, Data.Group.Abelian c, Data.Group.Abelian d, Data.Group.Abelian e) => Data.Group.Abelian (a, b, c, d, e)
instance Data.Group.Abelian ()
instance Data.Group.Cyclic a => Data.Group.Cyclic (GHC.Internal.Data.Functor.Const.Const a x)
instance Data.Group.Cyclic a => Data.Group.Cyclic (GHC.Internal.Data.Ord.Down a)
instance Data.Group.Cyclic a => Data.Group.Cyclic (GHC.Internal.Data.Functor.Identity.Identity a)
instance Data.Group.Cyclic (GHC.Internal.Data.Proxy.Proxy x)
instance GHC.Internal.Real.Integral a => Data.Group.Cyclic (GHC.Internal.Data.Semigroup.Internal.Sum a)
instance Data.Group.Cyclic ()
instance (Data.Group.Group (f a), Data.Group.Group (g a)) => Data.Group.Group ((GHC.Internal.Generics.:*:) f g a)
instance Data.Group.Group (f (g a)) => Data.Group.Group ((GHC.Internal.Generics.:.:) f g a)
instance Data.Group.Group a => Data.Group.Group (GHC.Internal.Data.Functor.Const.Const a x)
instance Data.Group.Group a => Data.Group.Group (GHC.Internal.Data.Ord.Down a)
instance Data.Group.Group a => Data.Group.Group (GHC.Internal.Data.Semigroup.Internal.Dual a)
instance Data.Group.Group b => Data.Group.Group (a -> b)
instance Data.Group.Group a => Data.Group.Group (GHC.Internal.Data.Functor.Identity.Identity a)
instance Data.Group.Group a => Data.Group.Group (Data.Functor.Contravariant.Op a b)
instance GHC.Internal.Real.Fractional a => Data.Group.Group (GHC.Internal.Data.Semigroup.Internal.Product a)
instance Data.Group.Group (GHC.Internal.Data.Proxy.Proxy x)
instance GHC.Internal.Num.Num a => Data.Group.Group (GHC.Internal.Data.Semigroup.Internal.Sum a)
instance (Data.Group.Group a, Data.Group.Group b) => Data.Group.Group (a, b)
instance (Data.Group.Group a, Data.Group.Group b, Data.Group.Group c) => Data.Group.Group (a, b, c)
instance (Data.Group.Group a, Data.Group.Group b, Data.Group.Group c, Data.Group.Group d) => Data.Group.Group (a, b, c, d)
instance (Data.Group.Group a, Data.Group.Group b, Data.Group.Group c, Data.Group.Group d, Data.Group.Group e) => Data.Group.Group (a, b, c, d, e)
instance Data.Group.Group ()
