RepLib-0.3: Generic programming library with representation types

Portabilityportable
Stabilityexperimental
MaintainerStephanie Weirich <sweirich@cis.upenn.edu>

Generics.RepLib.Bind.PermM

Description

A slow, but hopefully correct implementation of permutations.

Synopsis

Documentation

data Perm a Source

Instances

Ord a => Eq (Perm a) 
Show a => Show (Perm a) 

single :: Ord a => a -> a -> Perm aSource

(<>) :: Ord a => Perm a -> Perm a -> Perm aSource

Compose two permutations. The right-hand permutation will be applied first.

apply :: Ord a => Perm a -> a -> aSource

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

isid :: Ord a => Perm a -> BoolSource

isid -- do all keys map to themselves?

join :: Ord a => Perm a -> Perm a -> Maybe (Perm a)Source

Join two permutation. Fail if the two permutations map the same name to two different variables.

restrict :: Ord a => Perm a -> [a] -> Perm aSource