Can I create a function with an implicit argument?

I play with higher views and I try to use compose. I have the following code:

def p2( a : Int) = a + 2
def p3( a : Int) = a + 3
val p5 = p2 _ compose p3
def pn3[T](n : T)(implicit ev : Numeric[T]) = ev.plus(n, ev.fromInt(3))
val pn5 = p2 _ compose pn3

Everything works to the last line:

error: could not find implicit value for parameter ev: Numeric[T]

Which makes sense, but how can I say: "I want to Numeric[Int]!"

+5
source share
1 answer

Trial version and error;)

val pn5 = p2 _ compose pn3[Int]
+9
source

All Articles