hmt-0.15: Haskell Music Theory

Safe Haskell | None
Language | Haskell98

Music.Theory.Permutations.List

Description

List permutation functions.

Synopsis

- permutations :: Eq a => [a] -> [[a]]
- multiset_permutations :: Ord a => [a] -> [[a]]

# Documentation

permutations :: Eq a => [a] -> [[a]] Source #

Generate all permutations.

    permutations [0,3] == [[0,3],[3,0]]
    length (permutations [1..5]) == P.n_permutations 5

multiset_permutations :: Ord a => [a] -> [[a]] Source #

Generate all distinct permutations of a multi-set.

    multiset_permutations [0,1,1] == [[0,1,1],[1,1,0],[1,0,1]]