In some static languages, the inferred type for a and b could be Numeric, and foo's type could be:
(Numeric, Numeric) -> Numeric
Which seems good enough to me.But what if + is also String concatenation? Or any other overloading of "+". Then maybe the type of a and b is Something_that_can_be_+ed. The user can then think "ok, I'll pass a couple of Ints to obtain an Int, or a couple of Strings to obtain a String!". This also seems useful to me.