org.hnau.emitter.extensions.EmitterReduceExtensions.kt Maven / Gradle / Ivy
package org.hnau.emitter.extensions
import org.hnau.emitter.Emitter
import org.hnau.emitter.observing.push.always.line
inline fun Iterable>.reduce(
crossinline operation: (accumulator: S?, item: T?) -> S
) = line { it.reduce(operation) }
inline fun Iterable>.reduceIndexed(
crossinline operation: (index: Int, accumulator: S?, item: T?) -> S
) = line { it.reduceIndexed(operation) }
inline fun Iterable>.reduceRight(
crossinline operation: (item: T?, accumulator: S?) -> S
) = line { it.reduceRight(operation) }
inline fun Iterable>.reduceRightIndexed(
crossinline operation: (index: Int, item: T?, accumulator: S?) -> S
) = line { it.reduceRightIndexed(operation) }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy