| Copyright | (c) 2020-2021 Reed Mullanix Emily Pillmore |
|---|---|
| License | BSD-style |
| Maintainer | Reed Mullanix <reedmullanix@gmail.com>, Emily Pillmore <emilypi@cohomolo.gy> |
| Stability | stable |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Group.Free.Product
Description
This module provides definitions for the FreeProduct of two groups,
along with useful combinators.
Synopsis
- newtype FreeProduct g h = FreeProduct {
- runFreeProduct :: Seq (Either g h)
- simplify :: (Eq g, Eq h, Monoid g, Monoid h) => FreeProduct g h -> FreeProduct g h
- coproduct :: Monoid m => (a -> m) -> (b -> m) -> FreeProduct a b -> m
- injl :: a -> FreeProduct a b
- injr :: b -> FreeProduct a b
Documentation
newtype FreeProduct g h Source #
The free product on two alphabets
Note: This does not perform simplification upon multiplication or construction.
To do this, one should use simplify.
Constructors
| FreeProduct | |
Fields
| |
Instances
simplify :: (Eq g, Eq h, Monoid g, Monoid h) => FreeProduct g h -> FreeProduct g h Source #
O(n) Simplifies a word in a FreeProduct.
This means that we get rid of any identity elements, and perform multiplication of neighboring gs and hs.
coproduct :: Monoid m => (a -> m) -> (b -> m) -> FreeProduct a b -> m Source #
The FreeProduct of two Monoids is a coproduct in the category of monoids (and by extension, the category of groups).
injl :: a -> FreeProduct a b Source #
Left injection of an alphabet a into a free product.
injr :: b -> FreeProduct a b Source #
Right injection of an alphabet b into a free product.