An algebra for a monad for the list monad is precisely a monoid. For an action , the identity is and multiplication is . The algebra laws force the unit and associativity laws and determine as ordered multiplication. Conversely ordered multiplication defines a list action. Algebra morphisms are exactly monoid homomorphisms, giving an isomorphism of categories .
A monad consists of an endofunctor and natural transformations and , the unit and multiplication of a monad, satisfying
An algebra for a monad is with satisfying and . A morphism of algebras for a monad satisfies . These objects and morphisms form the Eilenberg-Moore category ; its composition works because is a functor.
For the list monad, is the set of finite ordered lists, including the empty list. The map applies to each entry; and concatenates a list of lists. The unit laws say that adding singleton brackets and then flattening changes nothing. Associativity says that flattening a list of lists of lists in either order produces the same ordered sequence. These descriptions also prove naturality.
If is an algebra for a monad, define
The singleton law gives . Apply the algebra associativity law to and to obtain . Applying it to and shows
Thus is a monoid. Applying the same law to shows inductively that is necessarily ordered multiplication of its entries, with the empty product .
Conversely, any monoid defines such a list-fold map . The monoid unit proves , and associativity and the unit prove that multiplying flattened lists equals multiplying their individual products, including empty sublists. Hence . An algebra morphism preserves the empty-list value and two-entry-list values, so it is a monoid homomorphism; conversely a monoid homomorphism preserves every ordered product and is an algebra morphism. Therefore
Thus list-monad algebras are monoids, with the identification also matching every morphism.