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 ?
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.