the first parameter type
the second parameter type
the result type
Invoke the function
Returns a new composed function which first applies the current function and then the one you pass as parameter.
Applies this function partially to one argument.
const plus5 = Function2.of(
(x:number,y:number)=>x+y)
.apply1(5);
assert.equal(6, plus5(1));
Returns a version of this function taking its parameters in the reverse order.
Returns a version of this function which takes a tuple instead of individual parameters. Useful in combination with Vector.zip for instance.
Generated using TypeDoc
Function2 encapsulates a function taking two parameters and returning a value. It adds some useful functions to combine or transform functions.