fork download
  1. object Main extends App {
  2. val list = List(1,2,3,4)
  3. def sqr(x:Int) = x*x
  4.  
  5. println(list.map(sqr))
  6. }
Success #stdin #stdout 0.37s 382016KB
stdin
Standard input is empty
stdout
List(1, 4, 9, 16)