group-theory-0.2.1.0: The theory of groups
Copyright (c) 2020-2021 Reed Mullanix Emily Pillmore Koji Miyazato BSD-style Reed Mullanix , Emily Pillmore stable non-portable Unsafe Haskell2010

Data.Group.Free.Internal

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

Instances details
 Eq a => Eq (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free.Internal Methods Ord a => Ord (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free.Internal Methods(<) :: FreeAbelianGroup a -> FreeAbelianGroup a -> Bool #(>) :: FreeAbelianGroup a -> FreeAbelianGroup a -> Bool # Show a => Show (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free.Internal MethodsshowList :: [FreeAbelianGroup a] -> ShowS # Ord a => Semigroup (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free.Internal Methodsstimes :: Integral b => b -> FreeAbelianGroup a -> FreeAbelianGroup a # Ord a => Monoid (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free.Internal Methodsmconcat :: [FreeAbelianGroup a] -> FreeAbelianGroup a # Ord a => Group (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free.Internal Methodspow :: Integral x => FreeAbelianGroup a -> x -> FreeAbelianGroup a # Ord a => Abelian (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free.Internal Source # Instance detailsDefined in Data.Group.Free.Internal Methods