Add sample for reduceOrNull and reduceRightOrNull

This commit is contained in:
Alfredo Delli Bovi
2019-12-13 19:17:04 +01:00
committed by Ilya Gorbunov
parent 06008c40ab
commit 9546307243
7 changed files with 82 additions and 0 deletions
@@ -12733,6 +12733,8 @@ public inline fun CharArray.reduceIndexed(operation: (index: Int, acc: Char, Cha
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12748,6 +12750,8 @@ public inline fun <S, T : S> Array<out T>.reduceOrNull(operation: (acc: S, T) ->
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12763,6 +12767,8 @@ public inline fun ByteArray.reduceOrNull(operation: (acc: Byte, Byte) -> Byte):
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12778,6 +12784,8 @@ public inline fun ShortArray.reduceOrNull(operation: (acc: Short, Short) -> Shor
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12793,6 +12801,8 @@ public inline fun IntArray.reduceOrNull(operation: (acc: Int, Int) -> Int): Int?
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12808,6 +12818,8 @@ public inline fun LongArray.reduceOrNull(operation: (acc: Long, Long) -> Long):
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12823,6 +12835,8 @@ public inline fun FloatArray.reduceOrNull(operation: (acc: Float, Float) -> Floa
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12838,6 +12852,8 @@ public inline fun DoubleArray.reduceOrNull(operation: (acc: Double, Double) -> D
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -12853,6 +12869,8 @@ public inline fun BooleanArray.reduceOrNull(operation: (acc: Boolean, Boolean) -
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13138,6 +13156,8 @@ public inline fun CharArray.reduceRightIndexed(operation: (index: Int, Char, acc
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13153,6 +13173,8 @@ public inline fun <S, T : S> Array<out T>.reduceRightOrNull(operation: (T, acc:
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13168,6 +13190,8 @@ public inline fun ByteArray.reduceRightOrNull(operation: (Byte, acc: Byte) -> By
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13183,6 +13207,8 @@ public inline fun ShortArray.reduceRightOrNull(operation: (Short, acc: Short) ->
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13198,6 +13224,8 @@ public inline fun IntArray.reduceRightOrNull(operation: (Int, acc: Int) -> Int):
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13213,6 +13241,8 @@ public inline fun LongArray.reduceRightOrNull(operation: (Long, acc: Long) -> Lo
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13228,6 +13258,8 @@ public inline fun FloatArray.reduceRightOrNull(operation: (Float, acc: Float) ->
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13243,6 +13275,8 @@ public inline fun DoubleArray.reduceRightOrNull(operation: (Double, acc: Double)
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@@ -13258,6 +13292,8 @@ public inline fun BooleanArray.reduceRightOrNull(operation: (Boolean, acc: Boole
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. Returns null if the array is empty.
*
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi