free-algebras-0.0.6.0: Free algebras in Haskell.

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
 Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Semigroup.Abelian Ord a => AbelianSemigroup (Min a) Source # Instance detailsDefined in Data.Semigroup.Abelian Ord a => AbelianSemigroup (Max a) Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Semigroup.Abelian Num a => AbelianSemigroup (Sum a) Source # Instance detailsDefined in Data.Semigroup.Abelian Num a => AbelianSemigroup (Product a) Source # Instance detailsDefined in Data.Semigroup.Abelian Ord a => AbelianSemigroup (Set a) Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Semigroup.Abelian Source # Instance detailsDefined in Data.Monoid.Abelian Source # Instance detailsDefined in Data.Semigroup.SemiLattice

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

Instances
 Source # Instance detailsDefined in Data.Semigroup.Abelian MethodsfoldMapFree :: (AlgebraType FreeAbelianSemigroup d, AlgebraType0 FreeAbelianSemigroup a) => (a -> d) -> FreeAbelianSemigroup a -> d Source # Eq a => Eq (FreeAbelianSemigroup a) Source # Instance detailsDefined in Data.Semigroup.Abelian Methods Ord a => Ord (FreeAbelianSemigroup a) Source # Instance detailsDefined in Data.Semigroup.Abelian Methods Show a => Show (FreeAbelianSemigroup a) Source # Instance detailsDefined in Data.Semigroup.Abelian MethodsshowList :: [FreeAbelianSemigroup a] -> ShowS # Source # Instance detailsDefined in Data.Semigroup.Abelian Methodsstimes :: Integral b => b -> FreeAbelianSemigroup a -> FreeAbelianSemigroup a # Source # Instance detailsDefined in Data.Semigroup.Abelian type AlgebraType0 FreeAbelianSemigroup (a :: Type) Source # Instance detailsDefined in Data.Semigroup.Abelian type AlgebraType0 FreeAbelianSemigroup (a :: Type) = Ord a type AlgebraType FreeAbelianSemigroup (a :: Type) Source # Instance detailsDefined in Data.Semigroup.Abelian type AlgebraType FreeAbelianSemigroup (a :: Type) = (Ord a, AbelianSemigroup a)

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

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