Scala 3, Programming Scala.
y = x - 1 y * y // val map3b: IndexedSeq[Int] = Vector(1, 0, 1, 4, 9, 16, 25, 36, 49, 64) The last example shows we can still put the => on a new line if we want, but it looks weird. Functions that take more than one argument work the same: val fold1a = xs.foldLeft(0) { (x, y) => x + y } // val