Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my opinion, requiring commutativity from a +-operator is maybe too much. Associativity and a neutral element seem to be enough (i.e. forming a monoid).


It seems like + normally connotes a commutative operator; for general monoid operators are normally notated as if they were multiplications.


> requiring commutativity from a +-operator is maybe too much

The + operator is the only one that can be realistically required to be commutative. All other operators need not. If we are to have any commutative operator, it should definitely be +.


I think that just shows that the python language and some others la k another operator and not that + should not be commutative.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: