Skip to content

Instantly share code, notes, and snippets.

@notyy
Created October 30, 2011 15:59
Show Gist options
  • Save notyy/1326066 to your computer and use it in GitHub Desktop.
Save notyy/1326066 to your computer and use it in GitHub Desktop.
strange
scala> val multInt = for(x <- (1 to 5)) yield (x*(_:Int))
multInt: scala.collection.immutable.IndexedSeq[Int => Int] = Vector(<function1>, <function1>, <function1>, <function1>, <function1>)
scala> val mult2 = multInt.map(_(2))
mult2: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 4, 6, 8, 10)
@ggd543
Copy link

ggd543 commented Oct 31, 2011

Interesting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment