Count, enumerate, rank and unrank combinatorial objects

Version on this page:0.1@rev:1
LTS Haskell 22.29:0.1.1@rev:1
Stackage Nightly 2024-07-13:0.1.1@rev:1
Latest on Hackage:0.1.1@rev:1

See all snapshots combinatorial appears in

BSD-3-Clause licensed and maintained by Henning Thielemann
This version can be pinned in stack with:combinatorial-0.1@sha256:07eaebcb1fa8ee0f9d94925d4c5ac3bc66a9a64fd20c1b2c99b821c209780caf,2380

Counting, enumerating, ranking and unranking of combinatorial objects. Well-known and less well-known basic combinatoric problems and examples.

The functions are not implemented in obviously stupid ways, but they are also not optimized to the maximum extent. The package is plain Haskell 98.

See also:

  • exact-combinatorics: Efficient computations of large combinatoric numbers.

  • combinat: Library for a similar purpose with a different structure and selection of problems.


Change log for the combinatorial package


  • added explicit export lists, thus hide some helper functions and alternative implementations

  • use alternative implementations in tests

  • chooseToIndex -> chooseRank, chooseFromIndex -> chooseUnrank


  • Tests: replaced (==>) and custom cardinal types by QC.forAll.

  • extracted from HTam package