[Haskell-cafe] Documentation [Comments from OCaml Hacker Brian Hurt]
andrewcoppin at btinternet.com
Fri Jan 16 14:18:56 EST 2009
Anton van Straaten wrote:
> It probably makes sense to do as Jeremy Shaw suggests and explicitly
> list the monoid laws, which would include the associative equality,
> but there really shouldn't be any other text in the definition of
> Monoid devoted to explaining what associativity means. Instead,
> linking words like "associative" to a definition in a glossary would
> make sense.
I don't know - associativity is almost the only property a monoid has.
(Obviously the other one is an identity element.)
Either way, wherever the description gets put, just saying
"associativity means that (x + y) + z = x + (y + z)" is insufficient.
Sure, that's the *definition* of what it is, but we should point out
that "associativity means that the ordering of the operations does not
affect the result" or something. Something that's intuitive. (The tricky
part, of course, is explaining how associative /= commutative.)
More information about the Haskell-Cafe