Handbook
Glossary
cum-reduce ( seq identity quot: ( prev elt -- next ) -- result cum-result )
Vocabulary
math
.
extras
Inputs
seq
an
object
identity
an
object
quot
a
quotation
with stack effect
( prev elt -- next )
Outputs
result
an
object
cum-result
an
object
Definition
USING:
kernel
sequences
;
IN:
math.extras
:
cum-reduce
( seq identity quot: ( prev elt -- next ) -- result cum-result )
[
dup
rot
]
dip
dup
[
[
curry
dip
dupd
]
curry
]
dip
compose
each
;
inline