Why does the signature of groupBy contain only one generic?

use*_*669 1 scala

This is the method signature:

groupBy[K](f: (A) ? K): immutable.Map[K, Repr]
Run Code Online (Sandbox Code Playgroud)

Shouldn't the following:

groupBy[A, K](f: (A) ? K): immutable.Map[K, Repr]
Run Code Online (Sandbox Code Playgroud)

be more appropriate since its taking a collection of A ?

iba*_*n04 5

There is no need to defined [A] type parameter on the methods level, because it's defined on the on class level e.g:

sealed abstract class List[+A]
Run Code Online (Sandbox Code Playgroud)

So when method is declared like this groupBy[K](f: (A) ? K): immutable.Map[K, Repr] A is already known.