chickadee » combinatorics » unordered-subset-map

unordered-subset-map f listprocedure
unordered-subset-map f list kprocedure

Map every k-combination (partial unordered subset) of list using f.

f
The mapping function
list
The list to map
k
k distinct elements (default: n)
(define unordered-subset-map
  (case-lambda
    ((f list) (unordered-subset-map f list (length list)))
    ((f list k)
     (unordered-subset-fold (lambda (v a) (cons (f v) a)) '() list k))))