O'Reilly logo
  • Simon Griffiths thinks this is interesting:

for (elem <- a if a % 2 == 0) yield 2 * elem

From

Cover of Scala for the Impatient

Note

Mistake in code, should read:
for(elem <- a if elem % 2 == 0) yield 2 * elem