Copyright | (c) 2020 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 |
Language | Haskell2010 |
This module provides definitions for Church-encoded
FreeGroup
s, FreeAbelianGroup
s, along with useful combinators.
Synopsis
- newtype FG a = FG {}
- interpretFG :: Group g => FG g -> g
- reifyFG :: FG a -> FreeGroup a
- reflectFG :: FreeGroup a -> FG a
- presentFG :: Group g => FG g -> (FG g -> g) -> g
- newtype FA a = FA {}
- forgetFA :: Group a => FA a -> FG a
- interpretFA :: Group g => FA g -> g
- reifyFA :: Ord a => FA a -> FreeAbelianGroup a
- reflectFA :: Ord a => FreeAbelianGroup a -> FA a
Church-encoded free groups
The Church-encoding of a FreeGroup
.
This datatype represents the free group on some a
-valued
generators. For more information on why this encoding is preferred,
see Dan Doel's article in
the Comonad Reader.
Church-encoded free group combinators
interpretFG :: Group g => FG g -> g Source #
Interpret a Church-encoded free group as a concrete FreeGroup
.
reflectFG :: FreeGroup a -> FG a Source #
Convert a concrete FreeGroup
to a Church-encoded free group.
Church-encoded free abelian groups
The Church-encoding of a FreeAbelianGroup
.
This datatype represents the free group on some a
-valued
generators, along with their exponents in the group.
Church-encoded free abelian group combinators
forgetFA :: Group a => FA a -> FG a Source #
Forget the commutative structure of a Church-encoded free abelian group, turning it into a standard free group.
interpretFA :: Group g => FA g -> g Source #
Interpret a Church-encoded free abelian group as a concrete FreeAbelianGroup
.
reifyFA :: Ord a => FA a -> FreeAbelianGroup a Source #
Convert a Church-encoded free abelian group to a concrete FreeAbelianGroup
.
reflectFA :: Ord a => FreeAbelianGroup a -> FA a Source #
Convert a concrete FreeAbelianGroup
to a Church-encoded free abelian group.