free-algebras-0.1.0.1: Free algebras
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Semigroup.Abelian

Synopsis

Documentation

class Semigroup m => AbelianSemigroup m Source #

Class of commutative monoids, e.g. with additional law: a <> b = b <> a

Instances

Instances details
AbelianSemigroup () Source # 
Instance details

Defined in Data.Semigroup.Abelian

AbelianSemigroup Void Source # 
Instance details

Defined in Data.Semigroup.Abelian

AbelianSemigroup All Source # 
Instance details

Defined in Data.Semigroup.Abelian

AbelianSemigroup Any Source # 
Instance details

Defined in Data.Semigroup.Abelian

AbelianSemigroup IntSet Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => AbelianSemigroup (Min a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => AbelianSemigroup (Max a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

AbelianSemigroup a => AbelianSemigroup (Option a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

AbelianSemigroup a => AbelianSemigroup (Dual a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Num a => AbelianSemigroup (Sum a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Num a => AbelianSemigroup (Product a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => AbelianSemigroup (Set a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => AbelianSemigroup (FreeAbelianSemigroup a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => AbelianSemigroup (FreeAbelianMonoid a) Source # 
Instance details

Defined in Data.Monoid.Abelian

Ord a => AbelianSemigroup (FreeSemilattice a) Source # 
Instance details

Defined in Data.Semigroup.Semilattice

data FreeAbelianSemigroup a Source #

Free abelian semigroup is isomorphic to a non empty map with keys a and values positive natural numbers.

It is a monad on the full subcategory which satisfies the Ord constraint, but base does not allow to define a functor / applicative / monad instances which are constraint by a class.

Instances

Instances details
FreeAlgebra FreeAbelianSemigroup Source # 
Instance details

Defined in Data.Semigroup.Abelian

Eq a => Eq (FreeAbelianSemigroup a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => Ord (FreeAbelianSemigroup a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Show a => Show (FreeAbelianSemigroup a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => Semigroup (FreeAbelianSemigroup a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

Ord a => AbelianSemigroup (FreeAbelianSemigroup a) Source # 
Instance details

Defined in Data.Semigroup.Abelian

type AlgebraType0 FreeAbelianSemigroup (a :: Type) Source # 
Instance details

Defined in Data.Semigroup.Abelian

type AlgebraType FreeAbelianSemigroup (a :: Type) Source # 
Instance details

Defined in Data.Semigroup.Abelian

fromNonEmpty :: Ord a => NonEmpty (a, Natural) -> Maybe (FreeAbelianSemigroup a) Source #

Smart constructor which creates FreeAbelianSemigroup from a non empty list of pairs (a, n) :: (a, Natural) where n > 0.