Handbook
Glossary
combinations-with-replacement-quot ( seq k quot -- seq quot' )
Vocabulary
math
.
combinatorics
.
private
Inputs
seq
an
object
k
an
object
quot
an
object
Outputs
seq
an
object
quot'
an
object
Definition
USING:
arrays
kernel
sequences
;
IN:
math.combinatorics.private
::
combinations-with-replacement-quot
( seq k quot -- seq quot' )
seq
length
:>
n n k
nCk-with-replacement
<iota>
k 0
<array>
seq quot n
[
[
[
nths-unsafe
]
curry
]
dip
compose
]
dip
[
[
[
[
drop
]
]
dip
]
dip
[
keep
]
2curry
compose
]
dip
[
next-combination-with-replacement
]
curry
compose
;
inline