Handbook
Glossary
map-reduce-outputs ( quot mapper reducer -- quot )
Factor handbook
»
The language
»
Combinators
»
Smart combinators
Prev:
reduce-outputs ( quot operation -- )
Next:
smart-apply ( quot n -- )
Vocabulary
combinators.smart
Inputs
quot
a
quotation
mapper
a
quotation
reducer
a
quotation
Outputs
quot
a
quotation
Word description
Infers the number of outputs from
quot
and, treating those outputs as a sequence, calls
map-reduce
on them.
Examples
USING: math combinators.smart prettyprint ; [ 1 2 3 ] [ sq ] [ + ] map-reduce-outputs .
14
Definition
USING:
kernel
;
IN:
combinators.smart
MACRO:
map-reduce-outputs
( quot mapper reducer -- quot )
[
[
map-outputs
]
2curry
]
dip
[
reduce-outputs
]
2curry
;