sym-0.9: Permutations, patterns, and statistics

MaintainerAnders Claesson <>
Safe HaskellNone




Permutation diagrams, or permutations as monads.


Data types

type Label a = Array Int aSource

The purpose of this data type is to assign labels to the indices of a given permutation.

data Permgram a Source

A permgram consists of a permutation together with a label for each index of the permutation.



perm :: Permgram a -> PermSource

The underlying permutation.

label :: Permgram a -> Label aSource

The assignment of labels to indices.

size :: Permgram a -> IntSource

The size of a permgram is the size of the underlying permutation.

Construct permgrams

permgram :: Perm -> [a] -> Permgram aSource

Construct a permgram from an underlying permutation and a list of labels.

inverse :: Permgram a -> Permgram aSource

The inverse permgram. It's obtained by mirroring the permgram in the x=y diagonal.