In the article written by Daniel Korzekwa, he said that the performance of following code:
list.map(e => e*2).filter(e => e>10)
is muc
To avoid traversing the list twice, I think the for syntax is a nice option here:
for
val list2 = for(v <- list1; e = v * 2; if e > 10) yield e