group-theory-0.2.0.0: The theory of groups

Copyright(c) 2020 Reed Mullanix Emily Pillmore Koji Miyazato
LicenseBSD-style
MaintainerReed Mullanix <reedmullanix@gmail.com>, Emily Pillmore <emilypi@cohomolo.gy>
Stabilitystable
Portabilitynon-portable
Safe HaskellUnsafe
LanguageHaskell2010

Data.Group.Free.Internal

Contents

Description

This module exposes internals of FreeAbelianGroup.

Synopsis

Free abelian groups

newtype FreeAbelianGroup a Source #

A representation of a free abelian group over an alphabet a.

The intuition here is group elements correspond with their positive or negative multiplicities, and as such are simplified by construction.

Examples:

>>> let single a = MkFreeAbelianGroup $ Map.singleton a 1
>>> a = single 'a'
>>> b = single 'b'
>>> a
FreeAbelianGroup $ fromList [('a',1)]
>>> a <> b
FreeAbelianGroup $ fromList [('a',1),('b',1)]
>>> a <> b == b <> a
True
>>> invert a
FreeAbelianGroup $ fromList [('a',-1)]
>>> a <> b <> invert a
FreeAbelianGroup $ fromList [('b',1)]
>>> gtimes 5 (a <> b)
FreeAbelianGroup $ fromList [('a',5),('b',5)]

Constructors

MkFreeAbelianGroup (Map a Integer)

Unsafe "raw" constructor, which does not do normalization work. Please use mkFreeAbelianGroup as it normalizes.

Instances
Eq a => Eq (FreeAbelianGroup a) Source # 
Instance details

Defined in Data.Group.Free.Internal

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

Defined in Data.Group.Free.Internal

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

Defined in Data.Group.Free.Internal

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

Defined in Data.Group.Free.Internal

Ord a => Monoid (FreeAbelianGroup a) Source # 
Instance details

Defined in Data.Group.Free.Internal

Ord a => Abelian (FreeAbelianGroup a) Source # 
Instance details

Defined in Data.Group.Free.Internal

Ord a => Group (FreeAbelianGroup a) Source # 
Instance details

Defined in Data.Group.Free.Internal

Ord a => GroupOrder (FreeAbelianGroup a) Source # 
Instance details

Defined in Data.Group.Free.Internal