[Haskell-cafe] Re: Difference between div and /

Henning Thielemann schlepptop at henning-thielemann.de
Thu Jun 3 01:52:44 EDT 2010


Richard O'Keefe schrieb:
> 
> On Jun 3, 2010, at 1:13 AM, Maciej Piechotka wrote:
> 
>> On Wed, 2010-06-02 at 14:01 +1200, Richard O'Keefe wrote:
>>> For what applications is it "useful" to use the same symbol
>>> for operations obeying (or in the case of floating point
>>> operations, *approximating* operations obeying) distinct laws?
>>>
>>>
>>
>> If the given operations do share something in common. For example * is
>> usually commutative. However you do use it with quaternions (Hamilton
>> product). You even write ij = k despite the fact that ji = -k.
> 
> I think you just made my point:  Commutativity is NOT one of the standard
> properties that * is EXPECTED to possess.  However, it IS one of the
> properties that + is expected to possess, which is why Java's abuse of
> + for string concatenation is so bad.

Java's (+) is not even associative:

("text" + 2) + 3 = "text23"
"text" + (2+3) = "text5"


More information about the Haskell-Cafe mailing list