Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / Reduced / <init>

<init>

Reduced(function: BiFunc<T, T, T>, items: Iterable<KScalar<T>>)Reduced(function: KBiFunc<T, T, T>, items: Iterable<KScalar<T>>)

Reduce iterable via BiFunc.

Reduced(
{ head, tail -> head + tail },
IterableOf({ 1 }, { 2 }, { 3 }, { 4 })
).invoke()

There is no thread-safety guarantee.

Parameters

T - KScalar type

function - Folding function

items - The scalars

Since 0.3