sym-0.4.1: Permutations, patterns, and statistics

MaintainerAnders Claesson <anders.claesson@gmail.com>
Safe HaskellNone

Math.Sym.D8

Contents

Description

The dihedral group of order 8 acting on permutations.

To avoid name clashes this module is best imported qualified; e.g.

 import qualified Math.Sym.D8 as D8

Synopsis

The group elements

r0 :: Perm a => a -> aSource

Ration by 0 degrees, i.e. the identity map.

r1 :: Perm a => a -> aSource

Ration by 90 degrees clockwise.

r2 :: Perm a => a -> aSource

Ration by 2*90 = 180 degrees clockwise.

r3 :: Perm a => a -> aSource

Ration by 3*90 = 270 degrees clockwise.

s0 :: Perm a => a -> aSource

Reflection through a horizontal axis (also called complement).

s1 :: Perm a => a -> aSource

Reflection through a vertical axis (also called reverse).

s2 :: Perm a => a -> aSource

Reflection through the main diagonal (also called inverse).

s3 :: Perm a => a -> aSource

Reflection through the anti-diagonal.

D8, the klein four-group, and orbits

d8 :: Perm a => [a -> a]Source

The dihedral group of order 8 (the symmetries of a square); that is,

 d8 = [r0, r1, r2, r3, s0, s1, s2, s3]

klein4 :: Perm a => [a -> a]Source

The Klein four-group (the symmetries of a non-equilateral rectangle); that is,

 klein4 = [r0, r2, s0, s1]

orbit :: Ord a => Perm a => [a -> a] -> a -> [a]Source

orbit fs x is the orbit of x under the functions in fs. E.g.,

 orbit klein4 "2314" == ["1423","2314","3241","4132"]

Aliases

id :: Perm a => a -> aSource

id = r0

rotate :: Perm a => a -> aSource

rotate = r1

complement :: Perm a => a -> aSource

complement = s0

reverse :: Perm a => a -> aSource

reverse = s1

inverse :: Perm a => a -> aSource

inverse = s2