3 ms·
You left off the associativity; you need (a + (b + c)) == ((a + b) + c), where + is the combining operation.
by jerf 9y ago
You left off the associativity; you need (a + (b + c)) == ((a + b) + c), where + is the combining operation.
- zephyz 9y agoI did. I left it out for two reasons: - the comment asked for a "simpler" explanation and associativity isn't a specially simple concept if you are not familiar with it and does not really help understand the core idea of a monoid. - in practice, monoid associativity isn't checked. Most type system aren't able to express it. Therefore, whenever you encounter a monoid you have no guarantee that it is indeed associative.
- feanaro 9y agoThere may be no guarantee, but that doesn't make a structure without associativity any more of a monoid, nor is having an identity element without associativity the core of idea of a monoid. If anything, associativity is the more important part of the concept since without an identity element, you are still left with a semigroup.