foldRightWithIndex<C> method

  1. @override
C foldRightWithIndex<C>(
  1. C c,
  2. C f(
    1. int i,
    2. C acc,
    3. T2 b
    )
)
override

Return value of type C by calling f with b and the second value of the Tuple2.

Implementation

@override
C foldRightWithIndex<C>(C c, C Function(int i, C acc, T2 b) f) =>
    foldRight<Tuple2<C, int>>(
      Tuple2(c, length() - 1),
      (t, a) => Tuple2(f(t.second, t.first, a), t.second - 1),
    ).first;