Agda-2.2.6: A dependently typed functional programming language and proof assistantSource codeContentsIndex
Agda.Utils.Permutation
Synopsis
data Permutation = Perm Integer [Integer]
permute :: Permutation -> [a] -> [a]
idP :: Integer -> Permutation
composeP :: Permutation -> Permutation -> Permutation
invertP :: Permutation -> Permutation
compactP :: Permutation -> Permutation
reverseP :: Permutation -> Permutation
expandP :: Integer -> Integer -> Permutation -> Permutation
topoSort :: (a -> a -> Bool) -> [a] -> Maybe Permutation
Documentation
data Permutation Source
permute [2,3,1] [x,y,z] = [y,z,x]
Constructors
Perm Integer [Integer]
permute :: Permutation -> [a] -> [a]Source
idP :: Integer -> PermutationSource
composeP :: Permutation -> Permutation -> PermutationSource
permute (compose p1 p2) == permute p1 . permute p2
invertP :: Permutation -> PermutationSource
compactP :: Permutation -> PermutationSource
Turn a possible non-surjective permutation into a surjective permutation.
reverseP :: Permutation -> PermutationSource
expandP :: Integer -> Integer -> Permutation -> PermutationSource
expandP i n  in the domain of  replace the ith element by n elements.
topoSort :: (a -> a -> Bool) -> [a] -> Maybe PermutationSource
Stable topologic sort. The first argument decides whether its first argument is an immediate parent to its second argument.
Produced by Haddock version 2.6.0