public
Created

  • Download Gist
gistfile1.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
scala> def f[A](x: A, xs: List[A]): List[A] = x :: xs
f: [A](x: A, xs: List[A])List[A]
 
scala> def g[A](x: A)(xs: List[A]): List[A] = x :: xs
g: [A](x: A)(xs: List[A])List[A]
 
scala> f(3, _)
<console>:9: error: missing parameter type for expanded function ((x$1) => f(3, x$1))
f(3, _)
^
 
scala> f(3, _: List[Int])
res1: List[Int] => List[Int] = <function1>
 
scala> g(3) _
res2: List[Int] => List[Int] = <function1>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.