Name: Anonymous 2012-10-27 0:24
Does anyone know the details why?
def map[T, U](a: List[T], f: (T) => U): List[U] =
for (e <- a) yield f(e)
def map0[T, U](a: List[T])(f: (T) => U): List[U] =
for (e <- a) yield f(e)
// type parameter necessary
map(List(1,2,3), (x: Int) => x.toString)
// type parameter not necessary
map0(List(1,2,3))(_.toString)