diff --git a/basis/math/combinatorics/combinatorics.factor b/basis/math/combinatorics/combinatorics.factor index 23638b0be6..962a2888d0 100644 --- a/basis/math/combinatorics/combinatorics.factor +++ b/basis/math/combinatorics/combinatorics.factor @@ -55,6 +55,10 @@ PRIVATE> [ [ length factorial iota ] keep ] dip '[ _ permutation @ ] each ; inline +: map-permutation ( seq quot -- ) + [ [ length factorial iota ] keep ] dip + '[ _ permutation @ ] map ; inline + : reduce-permutations ( seq identity quot -- result ) swapd each-permutation ; inline