foldRightIndexed
inline fun <T, R> Array<out T>.foldRightIndexed(
initial: R,
operation: (index: Int, T, acc: R) -> R
): R
(source)
inline fun <R> ShortArray.foldRightIndexed(
initial: R,
operation: (index: Int, Short, acc: R) -> R
): R
(source)
inline fun <R> FloatArray.foldRightIndexed(
initial: R,
operation: (index: Int, Float, acc: R) -> R
): R
(source)
inline fun <R> DoubleArray.foldRightIndexed(
initial: R,
operation: (index: Int, Double, acc: R) -> R
): R
(source)
inline fun <R> BooleanArray.foldRightIndexed(
initial: R,
operation: (index: Int, Boolean, acc: R) -> R
): R
(source)
@ExperimentalUnsignedTypes inline fun <R> ULongArray.foldRightIndexed(
initial: R,
operation: (index: Int, ULong, acc: R) -> R
): R
(source)
@ExperimentalUnsignedTypes inline fun <R> UByteArray.foldRightIndexed(
initial: R,
operation: (index: Int, UByte, acc: R) -> R
): R
(source)
@ExperimentalUnsignedTypes inline fun <R> UShortArray.foldRightIndexed(
initial: R,
operation: (index: Int, UShort, acc: R) -> R
): R
(source)
Accumulates value starting with initial value and applying operation from right to left to each element with its index in the original array and current accumulator value.
Returns the specified initial value if the array is empty.
Parameters
operation
- function that takes the index of an element, the element itself
and current accumulator value, and calculates the next accumulator value.
Accumulates value starting with initial value and applying operation from right to left to each element with its index in the original list and current accumulator value.
Returns the specified initial value if the list is empty.
Parameters
operation
- function that takes the index of an element, the element itself
and current accumulator value, and calculates the next accumulator value.