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


-- | Anything that associates
--   
--   In mathematics, a semigroup is an algebraic structure consisting of a
--   set together with an associative binary operation. A semigroup
--   generalizes a monoid in that there might not exist an identity
--   element. It also (originally) generalized a group (a monoid with all
--   inverses) to a type where every element did not have to have an
--   inverse, thus the name semigroup.
@package semigroups
@version 0.18.2


-- | This module provides generic deriving tools for monoids and semigroups
--   for product-like structures.
module Data.Semigroup.Generic
class GSemigroup f

-- | Generically generate a <a>Semigroup</a> (<a>&lt;&gt;</a>) operation
--   for any type implementing <a>Generic</a>. This operation will append
--   two values by point-wise appending their component fields. It is only
--   defined for product types.
--   
--   <pre>
--   <a>gmappend</a> a (<a>gmappend</a> b c) = <a>gmappend</a> (<a>gmappend</a> a b) c
--   </pre>
gmappend :: (Generic a, GSemigroup (Rep a)) => a -> a -> a
class GSemigroup f => GMonoid f

-- | Generically generate a <a>Monoid</a> <a>mempty</a> for any
--   product-like type implementing <a>Generic</a>.
--   
--   It is only defined for product types.
--   
--   <pre>
--   <a>gmappend</a> <a>gmempty</a> a = a = <a>gmappend</a> a <a>gmempty</a>
--   </pre>
gmempty :: (Generic a, GMonoid (Rep a)) => a
instance Data.Semigroup.Generic.GSemigroup GHC.Generics.U1
instance Data.Semigroup.Generic.GSemigroup GHC.Generics.V1
instance Data.Semigroup.Semigroup a => Data.Semigroup.Generic.GSemigroup (GHC.Generics.K1 i a)
instance Data.Semigroup.Generic.GSemigroup f => Data.Semigroup.Generic.GSemigroup (GHC.Generics.M1 i c f)
instance (Data.Semigroup.Generic.GSemigroup f, Data.Semigroup.Generic.GSemigroup g) => Data.Semigroup.Generic.GSemigroup (f GHC.Generics.:*: g)
instance Data.Semigroup.Generic.GMonoid GHC.Generics.U1
instance (Data.Semigroup.Semigroup a, GHC.Base.Monoid a) => Data.Semigroup.Generic.GMonoid (GHC.Generics.K1 i a)
instance Data.Semigroup.Generic.GMonoid f => Data.Semigroup.Generic.GMonoid (GHC.Generics.M1 i c f)
instance (Data.Semigroup.Generic.GMonoid f, Data.Semigroup.Generic.GMonoid g) => Data.Semigroup.Generic.GMonoid (f GHC.Generics.:*: g)
