Since I had trouble googling this question I thought I'd post it here.
I'm just interested in the logic behind it or wether it's just the creators' preference to use ++
instead. I mean, using a typeclass for strings that concatenates two strings (or rather lists) with +
does not seem too hard to imagine.
Edit: I should add, that in Haskell one has to suspect reasons behind it, because +
and ++
are functions defined in typeclasses, whereas in java the usage of +
for string concatenation is just part of the language's syntax and therefor subject only to the creators preference/opinion. (The answers so far suggest that I was right about my suspicion.)
Also haskell comes from a mathematical background and is deeply influenced by mathematical syntax, so there might be deeper reasons than just preference/opinion.