4 ms·
I think Combinable is more appropriate as 'append' pertains to only one of many associative binary operations.
by yohanatan 13y ago
I think Combinable is more appropriate as 'append' pertains to only one of many associative binary operations.
- cscheid 13y agoWhat about a group? Is that combinable too? Monoid is short, precise, and googlable. Which also happens to be the case with group, monad, functor, etc. Why invent new vocabulary? Have you noticed how little sense the words "class", "struct", "union", "object" make to someone who hasn't programmed before? It's just that we got used to them.
- lmm 13y agoClasses, unions and objects are all everyday words. I knew them from mathematics and everyday life before I ever used them in programming.
- dllthomas 13y agoAssociativeCombinableWithIdentity ... but I would rather learn what a "monoid" is, than type that out every time.
- axman6 13y agoI've considered Reducable, but I'm not sure that makes much sense either (such as when using a -> a as a monoid, you're not really reducing them). Combinable doesn't work because you're not necessarilly combining the values (Max and 0 for example doesn't really combine, it selects). So it is my conclusion that Monoid is a perfectly good name because that's exactly what a monoid is: something with an associative operator and a value which is the identity for the operator: (&&), True (||), False (+), 0 -- addition (*), 1 -- multiplication (++), [] -- concatenation of lists max, minBound -- maximum (.), id -- function composition and the identity function id x = x there are all monoids, it's such a simple concept that high school students could understand it within 10 minutes, and yet people whinge for calling it what it is. Good programmers are not people who are turned away by terms they don't know this easily.
- yohanatan 13y agoOh yea, I completely agree. There's no reason to be afraid of the terminology. I was just suggesting that Combinable seems a closer fit than Appendable for the general case (although, as you and others have pointed, even it falls short).