Associativity means that regrouping a sequence of applications does not change its result: a <> (b <> c) == (a <> b) <> c. The operands remain in the same order; only the grouping changes. section 7.3.1
Appending three CSV values illustrates the property. Both appendCsv a (appendCsv b c) and appendCsv (appendCsv a b) c produce the same result when appendCsv is associative. Haskell does not prove this law, so the implementer must verify it. section 7.3.1
In Haskell, associativity supports reusable combination APIs:
- Semigroup provides the binary associative operation <> for a type. section 7.3.1 section 7.5
- Monoid extends Semigroup with mempty, a neutral element, and mconcat for combining a list of values. section 7.3.1
- Associativity does not imply commutativity: changing a <> b to b <> a can change the required result. section 7.3.1




