reduce


function reduce<Type>(iter:Iterator<Type>, init:Type, op:\(Type, Type) -> Type) -> Type

Reduction.

  • iter: Iterator.
  • init: Initial value.
  • op: Operator.

function reduce<Type>(x:Type[_], init:Type, op:\(Type, Type) -> Type) -> Type

Reduction.

  • x: Vector.
  • init: Initial value.
  • op: Operator.