combinat-0.2.4.1: Generation of various combinatorial objects.Source codeContentsIndex
Math.Combinat.Sets
Description
Subsets.
Synopsis
choose :: Int -> [a] -> [[a]]
combine :: Int -> [a] -> [[a]]
compose :: Int -> [a] -> [[a]]
tuplesFromList :: Int -> [a] -> [[a]]
listTensor :: [[a]] -> [[a]]
kSublists :: Int -> [a] -> [[a]]
sublists :: [a] -> [[a]]
countKSublists :: Int -> Int -> Integer
countSublists :: Int -> Integer
Documentation
choose :: Int -> [a] -> [[a]]Source
All possible ways to choose k elements from a list, without repetitions. "Antisymmetric power" for lists. Synonym for kSublists.
combine :: Int -> [a] -> [[a]]Source
All possible ways to choose k elements from a list, with repetitions. "Symmetric power" for lists. See also Math.Combinat.Combinations. TODO: better name?
compose :: Int -> [a] -> [[a]]Source
A synonym for combine.
tuplesFromList :: Int -> [a] -> [[a]]Source

"Tensor power" for lists. Special case of listTensor:

 tuplesFromList k xs == listTensor (replicate k xs)

See also Math.Combinat.Tuples. TODO: better name?

listTensor :: [[a]] -> [[a]]Source
"Tensor product" for lists.
kSublists :: Int -> [a] -> [[a]]Source
Sublists of a list having given number of elements.
sublists :: [a] -> [[a]]Source
All sublists of a list.
countKSublists :: Int -> Int -> IntegerSource
# = binom { n } { k }.
countSublists :: Int -> IntegerSource
# = 2^n.
Produced by Haddock version 2.6.1