A is a type parameter. Just like a value parameter, for example, your passed parameter l , it is a βnameβ or place holder for some type, which can be different at different times (that is, with different method calls).
In your example, A not used, yes, using _ makes more sense and is clearer, but if you have to return an element from the list, then the type of the returned method will be A (or whatever name you want to give this parameter). Using _ as the return type does not make sense.
source share