Scala 3, Programming Scala.
and foldLeft methods: val xs = 0 until 10 // val xs: Range = Range 0 until 10 // The function arguments can either go on the next line after the colon // or on the same line: val map1a = xs.map { x => val y = x - 1 y * y } // val map1a: IndexedSeq[Int] = Vector(1, 0, 1, 4, 9, 16, 25, 36, 49, 64)