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

foldIndexed

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

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

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> Attribute<Sequence<T>>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): Attribute<R>
fun <T, R> Attribute<Sequence<T>>.foldIndexed(initial: Attribute<R>, operation: (index: Int, acc: R, T) -> R): Attribute<R>

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

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> Attribute<String>.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): Attribute<R>
fun <R> Attribute<String>.foldIndexed(initial: Attribute<R>, operation: (index: Int, acc: R, Char) -> R): Attribute<R>

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

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