This code compiles :
trait Plus[A] {
def plus(a1 : A , a2: A): A
}
def plus[A: Plus](a1: A, a2: A): A = implicitly[Plus[A]].plus(a1, a2)
//> plus: [A](a1: A, a2: A)(implicit evidence$1: day0.sumfunction.Plus[A])A
But if I attempt to use :
def plus[A: Plus](a1: A, a2: A): A = implicit[Plus[A]].plus(a1, a2)
Then I receive compile error : Multiple markers at this line - missing parameter type - identifier expected but '[' found.
Why can't I use implicit in this case ?
This code is taken from http://eed3si9n.com/learning-scalaz/polymorphism.html