A library for permutations and combinations.

Version on this page:
LTS Haskell 8.24:
Stackage Nightly 2017-03-09:
Latest on Hackage:

See all snapshots permutation appears in

BSD-3-Clause licensed by Patrick Perry
Maintained by Sophie Taylor
This version can be pinned in stack with:permutation-,2568
Used by 1 package in lts-6.35(full list with versions):

This library includes data types for storing permutations and combinations. It implements pure and impure types, the latter of which can be modified in-place. The library uses aggressive inlining and MutableByteArray#s internally, so it is very efficient.

The main utility of the library is converting between the linear representation of a permutation and a sequence of swaps. This allows, for instance, applying a permutation or its inverse to an array with O(1) memory use.

Much of the interface for the library is based on the permutation and combination functions in the GNU Scientific Library (GSL).