Let\'s consider a simple mapping example:
val a = Array(\"One\", \"Two\", \"Three\") val b = a.map(s => myFn(s))
What I need is to use
What about this? I think it should be fast and it's pretty. But I'm no expert on Scala speed...
a.foldLeft(0) ((i, x) => {myFn(x, i); i + 1;} )