transform_reduce
function transform_reduce<Input, Output>(x:Input[_], init:Output, op1:\(Output, Output) -> Output, op2:\(Input) -> Output) -> Output
Unary transformation and reduction.
- x: First operand.
- init: Initial value.
- op1: Reduction operator.
- op2: Transformation operator.
function transform_reduce<Input1, Input2, Output>(x:Input1[_], y:Input2[_], init:Output, op1:\(Output, Output) -> Output, op2:\(Input1, Input2) -> Output) -> Output
Binary transformation and reduction.
- x: First operand.
- y: Second operand.
- init: Initial value.
- op1: Reduction operator.
- op2: Transformation operator.
function transform_reduce<Input1, Input2, Input3, Output>(x:Input1[_], y:Input2[_], z:Input3[_], init:Output, op1:\(Output, Output) -> Output, op2:\(Input1, Input2, Input3) -> Output) -> Output
Ternary transformation and reduction.
- x: First operand.
- y: Second operand.
- z: Third operand.
- init: Initial value.
- op1: Reduction operator.
- op2: Transformation operator.