4 ms·
> 2. But weirdly enough, many operators aren't generic. String concatenation is performed with "++" but addition with "+". Concatenation and addition don't sha
by Dewie 13y ago
> 2. But weirdly enough, many operators aren't generic. String concatenation is performed with "++" but addition with "+".
Concatenation and addition don't share the same algebraic properties (concatenation is not commutative). Haskell has a mathy bias (for example see the monoid typeclass, which I guess you can use if you want to use the same operator for concatenation and for addition) so this choice isn't very surprising.
Besides, it seems like Haskell chooses to have more specialized functions/operators in Prelude while their generalizations are reserved for other modules. For example "map" for lists, "composition" (.) for functions, but "fmap" for functors in general.