Using the Scala REPL, I've defined a function that takes an Int as its first parameter and a function with this signature Int => Int as the second implicit parameter:
scala> def doer(i: Int)(implicit a: Int => Int): Int = a(i)
doer: (i: Int)(implicit a: Int => Int)Int
Why does running this function without providing the implicit parameter work?
scala> doer(4)
res1: Int = 4
Where does the implicit Int to Int function come from? The REPL reports that there are no implicits defined:
scala> :impl
No implicits have been imported other than those in Predef.
implicitparameters which use at least one type that is defined by my code. This means that there is no danger of confusion withimplicitvalues defined in other libraries. - Tim