This article will take about 1 minute to read.
object M fun M.Sigma(from: Int, to: Int, each: (x: Int) -> Double): Double = (from..to).sumOf(each) val M.Σ get() = M::Sigma fun main{ println(M.Σ(0, 6) { (it * it).toDouble() }) }