From what I assume, Foo [T1, T2] just means he defined two type parameters, he doesn't need to take T1 and return T2 .
A type parameter means "I need some type, but I'm not interested in knowing what kind of concrete type it is," where "I" is the programmer who writes the code. Type parameters can be used like any other type, such as Int, String or Complex - the only difference is that they are unknown until they are used.
See type Map[A, +B] . When you first read this, you may not know what A and B are for, so you should read the documentation:
Map from type A keys to type B values.
He explains types and their meaning. To know and understand nothing more. These are just two types. You can call Map something like Map[Key, Value] , but inside the source code it is better if the type parameters have only one or two letters. This simplifies the distinction between type parameters and specific types.
This is documentation that indicates what a type parameter means. And if there is no documentation, you should take a look at the sources and find their meaning yourself. For example, you should do this with Function2 [-T1, -T2, +R] . The documentation only tells us about this:
A function of two parameters.
Well, we know that two of the three type parameters are the parameters that the function expects, but what is the third? Take a look at the sources:
def apply (v1: T1, v2: T2): R
Ah, now we know that T1 and T2 are parameters, and R is the return type.
Type parameters can also be found in method signatures, such as map:
class List[+A] { .. def map[B](f: (A) ⇒ B): List[B] }
This is what a map looks like when you use it with a list. A can be any type - this is the type of elements contained in the list. B is another arbitrary type. When you know what a card does, you know what B does. Otherwise, you must understand the map before. map expects a function that can convert each element of the list to another element. Since you know that A stands for list items, you can extract from yourself that B must be of type A , converted to.
To answer all your other questions: this should not be done in any answer. There are many other questions and answers on StackOverflow that can also answer your questions.
Summary
When you see some type parameters, for example, in Foo[T1, T2] , you should not start crying. Think: “Well, I have a Foo that expects T1 and T2, and if I want to know what they are doing, I need to read the documentation or sources.”