math.combinators: Add map-permutation

db4
Doug Coleman 2012-04-18 14:43:08 -07:00
parent 161cd8222c
commit 229d0e0549
1 changed files with 4 additions and 0 deletions

View File

@ -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