Generics should not force you to mention irrelevant information:
isEmpty: <T>(xs: List<T>) => boolean;
Why should I have to name the element type? This function doesn't examine any elements at all.
isEmpty: (xs: List) => boolean;
Should be good enough.
Conversation
Scala lets you not mention it.
def isEmpty(xs: List[_]): Boolean
The reason you can't use just `List` is because that syntax refers to the type constructor itself; would be hard to overload it to refer to its application too.
1
1
Yeah, it's like talking about a function `f`, rather than the application `f(x)`. Even if your language doesn't support mentioning `F` on it's own, adding implicit applications seems like it'd cause even more divergence between the type an term languages than is currently there.
1
I do like the idea of using `_` for anonymous, automatic generalization of definitions though. That's nifty.


