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

Data.Group.Free.Church

Description

This module provides definitions for Church-encoded FreeGroups, FreeAbelianGroups, along with useful combinators.

Synopsis

# Church-encoded free groups

newtype FG a Source #

The Church-encoding of a FreeGroup.

This datatype represents the "true" free group in Haskell on some a-valued generators. For more information on why this encoding is preferred, see Dan Doel's article in the Comonad Reader.

While FreeGroup et al are free in a strict language, and are more intuitive, they are not associative wtih respect to bottoms. FG and FA however, are, and should be preferred when working with possibly undefined data.

Constructors

 FG FieldsrunFG :: forall g. Group g => (a -> g) -> g

#### Instances

Instances details

## Church-encoded free abelian group combinators

forgetFA :: Ord 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 :: Abelian 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.

Convert a concrete FreeAbelianGroup to a Church-encoded free abelian group.