Compositions. This module is equivalent to the module Combinations, but it turns out that "compositions" is the accepted name. I will remove the Combinations module in the future.
- compositions' :: [Int] -> Int -> [[Int]]
- countCompositions' :: [Int] -> Int -> Integer
- allCompositions' :: [Int] -> [[[Int]]]
- compositions :: Integral a => a -> a -> [[Int]]
- countCompositions :: Integral a => a -> a -> Integer
- compositions1 :: Integral a => a -> a -> [[Int]]
- countCompositions1 :: Integral a => a -> a -> Integer
Documentation
Compositions fitting into a given shape and having a given degree. The order is lexicographic, that is,
sort cs == cs where cs = compositions' shape k
countCompositions' :: [Int] -> Int -> IntegerSource
allCompositions' :: [Int] -> [[[Int]]]Source
All compositions fitting into a given shape.
countCompositions :: Integral a => a -> a -> IntegerSource
# = \binom { len+d-1 } { len-1 }
Positive compositions of a given length.
countCompositions1 :: Integral a => a -> a -> IntegerSource