|
|
|
|
|
by sodapopcan
971 days ago
|
|
I think it is pretty standard in functional languages not to overload operators. There may be technical reasons as well, I'm a bit out of my depth here, but it probably is better for performance with pattern matching knowing the type? Like `"hello " <> there = "hello there"`. Of course it's not just strings—concatenating lists uses ++ and for dates have their own functions. OCaml takes it a step further with numbers where `+` only works on integers. You need to do `+.` to add floats. This lets it be statically typed without having to actually specify any types. Again, a little out of my depth in terms of rock solid explanations. |
|