Documentation / dataflow / com.femastudios.dataflow.extensions / foldIndexed
Go to reference

foldIndexed

fun <T, R> Field<Iterable<T>>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): Field<R>
fun <T, R> Field<Iterable<T>>.foldIndexed(initial: Field<R>, operation: (index: Int, acc: R, T) -> R): Field<R>

Same as foldIndexed, but accepts Field and returns a new Field.

Calling this function is equivalent to use transform and calling foldIndexed in the transformation function.

This is simply a convenience function.

See Also

kotlin.collections.foldIndexed


fun <T, R> Field<Sequence<T>>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): Field<R>
fun <T, R> Field<Sequence<T>>.foldIndexed(initial: Field<R>, operation: (index: Int, acc: R, T) -> R): Field<R>

Same as foldIndexed, but accepts Field and returns a new Field.

Calling this function is equivalent to use transform and calling foldIndexed in the transformation function.

This is simply a convenience function.

See Also

kotlin.sequences.foldIndexed


fun <R> Field<String>.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): Field<R>
fun <R> Field<String>.foldIndexed(initial: Field<R>, operation: (index: Int, acc: R, Char) -> R): Field<R>

Same as foldIndexed, but accepts Field and returns a new Field.

Calling this function is equivalent to use transform and calling foldIndexed in the transformation function.

This is simply a convenience function.

See Also

kotlin.text.foldIndexed