reduceToData

inline fun <T : Any, R : Any> Collection<Data<T>>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, crossinline block: suspend (List<ValueWithMeta<T>>) -> R): Data<R>

Lazily reduce a collection of Data to a single data.


fun <K, T : Any, R : Any> Map<K, Data<T>>.reduceToData(outputType: KType, coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, block: suspend (Map<K, ValueWithMeta<T>>) -> R): Data<R>
inline fun <T : Any, R : Any> Iterable<Data<T>>.reduceToData(outputType: KType, coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, crossinline transformation: suspend (Collection<ValueWithMeta<T>>) -> R): Data<R>
inline fun <T : Any, R : Any> Iterable<Data<T>>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, crossinline transformation: suspend (Collection<ValueWithMeta<T>>) -> R): Data<R>
inline fun <T : Any, R : Any> DataSet<T>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, crossinline transformation: suspend (Iterable<NamedValueWithMeta<T>>) -> R): Data<R>


inline fun <K, T : Any, R : Any> Map<K, Data<T>>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, crossinline block: suspend (Map<K, ValueWithMeta<T>>) -> R): Data<R>

Lazily reduce a Map of Data with any static key.

Parameters

K

type of the map key

T

type of the input goal

R

type of the result goal