it's so easy to write it yourself: ``` inline fun ...
# stdlib
k
it's so easy to write it yourself:
Copy code
inline fun <T>Iterable<T>.average(toValue: (T) -> Double): Double {
    var sum: Double = 0.0
    var count: Int = 0
    for (element in this) {
        sum += toValue(element)
        count += 1
    }
    return if (count == 0) 0.0 else sum / count
}