foldRightWithIndex<C> method

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

Implementation

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