sym-0.13.0: Permutations, patterns, and statistics

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

Sym.Permgram

Contents

Description

Permutation diagrams, or permutations as monads.

Synopsis

Data types

type Label a = Vector a Source #

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.

Instances

Monad Permgram Source # 

Methods

(>>=) :: Permgram a -> (a -> Permgram b) -> Permgram b #

(>>) :: Permgram a -> Permgram b -> Permgram b #

return :: a -> Permgram a #

fail :: String -> Permgram a #

Functor Permgram Source # 

Methods

fmap :: (a -> b) -> Permgram a -> Permgram b #

(<$) :: a -> Permgram b -> Permgram a #

Applicative Permgram Source # 

Methods

pure :: a -> Permgram a #

(<*>) :: Permgram (a -> b) -> Permgram a -> Permgram b #

(*>) :: Permgram a -> Permgram b -> Permgram b #

(<*) :: Permgram a -> Permgram b -> Permgram a #

Eq a => Eq (Permgram a) Source # 

Methods

(==) :: Permgram a -> Permgram a -> Bool #

(/=) :: Permgram a -> Permgram a -> Bool #

Ord a => Ord (Permgram a) Source # 

Methods

compare :: Permgram a -> Permgram a -> Ordering #

(<) :: Permgram a -> Permgram a -> Bool #

(<=) :: Permgram a -> Permgram a -> Bool #

(>) :: Permgram a -> Permgram a -> Bool #

(>=) :: Permgram a -> Permgram a -> Bool #

max :: Permgram a -> Permgram a -> Permgram a #

min :: Permgram a -> Permgram a -> Permgram a #

Show a => Show (Permgram a) Source # 

Methods

showsPrec :: Int -> Permgram a -> ShowS #

show :: Permgram a -> String #

showList :: [Permgram a] -> ShowS #

Accessors

perm :: Permgram a -> Perm Source #

The underlying permutation.

label :: Permgram a -> Label a Source #

The assignment of labels to indices.

size :: Permgram a -> Int Source #

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

Construct permgrams

permgram :: Perm -> [a] -> Permgram a Source #

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

inverse :: Permgram a -> Permgram a Source #

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