group-theory-0.2.0.0: The theory of groups

Copyright(c) 2020 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>, Reed Mullanix <reedmullanix@gmail.com>
Stabilitystable
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.Group.Cyclic

Contents

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 #

Methods

generator :: a #

Instances
Cyclic () 
Instance details

Defined in Data.Group

Methods

generator :: () #

Cyclic a => Cyclic (Identity a) 
Instance details

Defined in Data.Group

Methods

generator :: Identity a #

Integral a => Cyclic (Sum a) 
Instance details

Defined in Data.Group

Methods

generator :: Sum a #

Cyclic a => Cyclic (Down a) 
Instance details

Defined in Data.Group

Methods

generator :: Down a #

Cyclic (Proxy x) 
Instance details

Defined in Data.Group

Methods

generator :: Proxy x #

Cyclic a => Cyclic (Const a x) 
Instance details

Defined in Data.Group

Methods

generator :: 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] #