In a comment for SIP-13 Martin Odersky implied that it is possible to create an implicit method with multiple arguments. According to my experiences, implicit methods always have exactly one argument and I cannot imagine how an implicit method with multiple arguments can be used. Can someone give some use case and explanation?
For example if you need an implicit parameter of a function type:
implicit def foo(x: Int, y: Int) = y * x
def bar(x: Int, y: Int)(implicit f: (Int, Int) => Int) = f(x,y)
scala> bar(3,4)
res3: Int = 12
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With