foldRightFirstWithIndex<C> method

C foldRightFirstWithIndex<C>(
  1. C c,
  2. C f(
    1. int i,
    2. C c,
    3. T1 b
    )
)

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

Implementation

C foldRightFirstWithIndex<C>(C c, C Function(int i, C c, T1 b) f) =>
    foldRightFirst<Tuple2<C, int>>(
      Tuple2(c, length() - 1),
      (t, a) => Tuple2(f(t.second, t.first, a), t.second - 1),
    ).first;