group-theory-0.1.0.0: The theory of groups
Copyright(c) 2020 Reed Mullanix Emily Pillmore
LicenseBSD-style
MaintainerReed Mullanix <reedmullanix@gmail.com>, Emily Pillmore <emilypi@cohomolo.gy>
Stabilitystable
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.Group.Free

Description

This module provides definitions for FreeGroups and FreeAbelianGroups, along with useful combinators.

Synopsis

Free groups

newtype FreeGroup a Source #

A representation of a free group over an alphabet a.

The intuition here is that Left a represents a "negative" a, whereas Right a represents "positive" a.

Note: This does not perform simplification upon multiplication or construction. To do this, one should use simplify.

Constructors

FreeGroup 

Fields

Instances

Instances details
Monad FreeGroup Source # 
Instance details

Defined in Data.Group.Free

Methods

(>>=) :: FreeGroup a -> (a -> FreeGroup b) -> FreeGroup b #

(>>) :: FreeGroup a -> FreeGroup b -> FreeGroup b #

return :: a -> FreeGroup a #

Functor FreeGroup Source # 
Instance details

Defined in Data.Group.Free

Methods

fmap :: (a -> b) -> FreeGroup a -> FreeGroup b #

(<$) :: a -> FreeGroup b -> FreeGroup a #

Applicative FreeGroup Source # 
Instance details

Defined in Data.Group.Free

Methods

pure :: a -> FreeGroup a #

(<*>) :: FreeGroup (a -> b) -> FreeGroup a -> FreeGroup b #

liftA2 :: (a -> b -> c) -> FreeGroup a -> FreeGroup b -> FreeGroup c #

(*>) :: FreeGroup a -> FreeGroup b -> FreeGroup b #

(<*) :: FreeGroup a -> FreeGroup b -> FreeGroup a #

Alternative FreeGroup Source # 
Instance details

Defined in Data.Group.Free

Methods

empty :: FreeGroup a #

(<|>) :: FreeGroup a -> FreeGroup a -> FreeGroup a #

some :: FreeGroup a -> FreeGroup [a] #

many :: FreeGroup a -> FreeGroup [a] #

Cancelative FreeGroup Source # 
Instance details

Defined in Control.Applicative.Cancelative

Methods

cancel :: FreeGroup a -> FreeGroup a Source #

GroupFoldable FreeGroup Source # 
Instance details

Defined in Data.Group.Foldable

Methods

goldMap :: Group g => (a -> g) -> FreeGroup a -> g Source #

toFG :: FreeGroup a -> FG a Source #

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

Defined in Data.Group.Free

Methods

(==) :: FreeGroup a -> FreeGroup a -> Bool #

(/=) :: FreeGroup a -> FreeGroup a -> Bool #

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

Defined in Data.Group.Free

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

Defined in Data.Group.Free

Semigroup (FreeGroup a) Source # 
Instance details

Defined in Data.Group.Free

Methods

(<>) :: FreeGroup a -> FreeGroup a -> FreeGroup a #

sconcat :: NonEmpty (FreeGroup a) -> FreeGroup a #

stimes :: Integral b => b -> FreeGroup a -> FreeGroup a #

Monoid (FreeGroup a) Source # 
Instance details

Defined in Data.Group.Free

Group (FreeGroup a) Source # 
Instance details

Defined in Data.Group.Free

Free group combinators

simplify :: Eq a => FreeGroup a -> FreeGroup a Source #

O(n) Simplifies a word in a free group.

Examples:

Expand
>>> simplify $ FreeGroup [Right 'a', Left 'b', Right 'c', Left 'c', Right 'b', Right 'a']
FreeGroup {runFreeGroup = [Right 'a',Right 'a']}

interpret :: Group g => FreeGroup g -> g Source #

O(n) Interpret a word in a free group over some group g as an element in a group g.

interpret' :: Group g => FreeGroup g -> g Source #

O(n) Strict variant of interpret.

present :: Group g => FreeGroup g -> (FreeGroup g -> g) -> g Source #

Present a Group as a FreeGroup modulo relations.

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.

Constructors

FreeAbelianGroup 

Fields

Instances

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

Defined in Data.Group.Free

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

Defined in Data.Group.Free

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

Defined in Data.Group.Free

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

Defined in Data.Group.Free

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

Defined in Data.Group.Free

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

Defined in Data.Group.Free

Free abelian group combinators

abmap :: Ord b => (a -> b) -> FreeAbelianGroup a -> FreeAbelianGroup b Source #

Functorial fmap for a FreeAbelianGroup.

singleton :: a -> FreeAbelianGroup a Source #

Lift a singular value into a FreeAbelianGroup. Analogous to pure.

abInterpret :: Group g => FreeAbelianGroup g -> g Source #

Interpret a free group as a word in the underlying group g.