blob: d961110cda3007884a8bc9aa6be374f310f19267 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
trait Fun1[@specialized +R, @specialized -T] {
def apply(x: T): R
}
object Main {
def mapA[@specialized B](xs: Array[B], f: Fun1[B, B]): Unit = {
for (i <- 0 until xs.length)
xs(i) = f(xs(i))
}
}
|