In a perfect world, a compiler would optimize this code to be equivalent to summing in a simple loop, at least if series were a projection or had a non-strict map function. Whether scalac and the JVM can work together to do this right now or not is beyond my knowledge. Hopefully specialization in Scala 2.8 will at least get the JVM one major step closer.