foldLeftWithIndex<C> method

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

Return the result of f called with b and the value of Right. If this Either is Left, return b.

Implementation

@override
C foldLeftWithIndex<C>(C c, C Function(int i, C acc, R b) f) =>
    foldLeft<(C, int)>(
      (c, 0),
      (t, b) => (f(t.$2, t.$1, b), t.$2 + 1),
    ).$1;