Scala 3, Programming Scala.
val y = x - 1 y * y } // val map1b: IndexedSeq[Int] = Vector(1, 0, 1, 4, 9, 16, 25, 36, 49, 64) val map2b = xs.map: x => val y = x - 1 y * y // val map2b: IndexedSeq[Int] = Vector(1, 0, 1, 4, 9, 16, 25, 36, 49, 64) // It looks odd, but the arrow can be on the next line: val map3b = xs.map: x => val