tri-curry ( x p q r -- p' q' r' )
Factor handbook > The language > Combinators > Compositional combinators > Curried dataflow combinators

Prev:bi-curry ( x p q -- p' q' )
Next:bi-curry* ( x y p q -- p' q' )


Vocabulary
kernel

Inputs and outputs
xan object
pa quotation with stack effect ( x -- ... )
qa quotation with stack effect ( x -- ... )
ra quotation with stack effect ( x -- ... )
p'[ x p ]
q'[ x q ]
r'[ x r ]


Word description
Partially applies p, q and r to x.

Notes
The following two lines are equivalent:
[ p ] [ q ] [ r ] tri-curry [ call ] tri@ [ p ] [ q ] [ r ] tri

Higher-arity variants of tri can be built from tri-curry:
[ p ] [ q ] [ r ] tri-curry tri == [ p ] [ q ] [ r ] 2tri [ p ] [ q ] [ r ] tri-curry tri-curry bi == [ p ] [ q ] [ r ] 3tri

The combination tri-curry tri* cannot be expressed with the non-currying dataflow combinators alone; it handles the case where you have four values a b c d on the stack, and you wish to apply p to a d, q to b d and r to c d.

Definition