O'Reilly logo
  • saeed Abooleet thinks this is interesting:

// filter the items, then double them scala> val nums = List(1,2,3,4,5).filter(_ < 4).map(_ * 2) nums: List[Int] = List(2, 4, 6)

From

Cover of Scala Cookbook

Note

Examples of filter and double