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

Data.Group.Cyclic

Description

This module contains definitions for Cyclic groups, along with the relevant combinators.

Synopsis

# Cyclic groups

Cyclic is a Group that is generated by a single element. This element is called a generator of the group. There can be many generators for a group, e.g., any representative of an equivalence class of prime numbers of the integers modulo n, but to make things easy, we ask for only one generator.

class Group a => Cyclic a where #

A Group G is Cyclic if there exists an element x of G such that for all y in G, there exists an n, such that

y = pow x n

Methods

generator :: a #

The generator of the Cyclic group.

#### Instances

Instances details
 Cyclic () Instance detailsDefined in Data.Group Methodsgenerator :: () # Cyclic a => Cyclic (Identity a) Instance detailsDefined in Data.Group Methods Integral a => Cyclic (Sum a) Instance detailsDefined in Data.Group Methods Cyclic a => Cyclic (Down a) Instance detailsDefined in Data.Group Methods Cyclic (Proxy x) Instance detailsDefined in Data.Group Methods Cyclic a => Cyclic (Const a x) Instance detailsDefined in Data.Group Methodsgenerator :: Const a x #

## Combinators

classify :: (Eq a, Cyclic a) => (a -> Bool) -> [a] Source #

Classify elements of a Cyclic group.

Apply a classifying function a -> Bool to the elements of a Cyclic group as generated by its designated generator.

### Examples:

>>> take 3 \$ classify (< (3 :: Sum Word8))
[Sum {getSum = 1},Sum {getSum = 2}]


generated :: Cyclic a => [a] #

Generate all elements of a Cyclic group using its generator.

Note: Fuses, does not terminate even for finite groups.