3 ms·
> I know it sounds like a small thing, I think the case is obvious for integer vs floats -- addition should be addition. Many languages don't use "+" for stri
by jwatte 9y ago
> I know it sounds like a small thing,
I think the case is obvious for integer vs floats -- addition should be addition.
Many languages don't use "+" for string addition, because string addition is not commutative (a+b != b+a)
SQL, for example, uses "||" for this, and Haskell uses "++"
That being said, argument type overloading is important for clarity. One of the famous failures in Haskell is "map" only works on lists, and "fmap" on other functors.