posted 9 years ago
Hi, Joe.

Monoid is type and **operation** which obeys monoid laws. Type alone do not define a monoid. For example, (Int, +) and (Int, *) are monoids for the Int type. Monoid rules define relationships between values and functions. They do not define an "identity function" itself. So it's not clear what do you mean when you say that rules could be represented by two functions.

Anyway, folds are not related to monoids. You could apply foldLeft operation to any collection of items and any operation. For monoid type and operation and for ordered collections (all these should apply at the same time) left and right folds would produce same result. But you can apply these folds for non-monoid operation on the type. For example, you could fold List[Int] using divide operation. So these operations are not specific (or related) to monoids at all.