I'm trying to understand some autogenerated code by the scala compiler but I don't know after what to search.
I have the following class:
trait Arrow1[F[_, _]]
abstract class Test {
def f1[F[_, _] : Arrow1, A, B, C](fa: F[A,B], fb: F[A, C]): F[A, (B, C)]
def f2[A: Seq, B](a: A): Boolean
}
After I decompiled the class file, the signature of the f1 and f2 methods look like:
public abstract class Test {
public abstract <F, A, B, C> F f1(F var1, F var2, Arrow1<F> var3);
public abstract <A, B> boolean f2(A var1, Seq<A> var2);
}
As you can see, the methods have an additional parameter. Where can I find some documentation about this method type parameter notation F[_, _] : Arrow1 ?
You are looking for "context bounds".
When you look up "Type parameters" in the Spec, you encounter
A: B
in the first paragraph, and you also get the link to Context Bounds and View Bounds, where it says (Quote slightly changed, simplified to case with single context bound):Here is a link to FAQ with more information on the topic.