[Haskell-cafe] Monads vs. monoids

Joachim Durchholz jo at durchholz.org
Tue Jul 17 20:36:46 UTC 2018


Am 17.07.2018 um 22:23 schrieb Olaf Klinke:
> You could say that every monad harbors a monoid, and that every monoid 
> arises this way. But of course the whole and the part are not the same.

Agreed.

> That depends on the definition of "monoid". If a monoid is a set with 
> certain structure, then a monad is not a monoid.

That's the perspective from which I'm looking at abstract data types: A 
set of values, a set of operations, a set of axioms over the operations 
and values.
Well, that's the textbook definition, there's a lot of data structures 
that have multiple value sets but still are related through axioms. I 
just don't know an example of such a structure that it could make it 
into the textbooks :-)

 From that perspective, monads and monoids are distinct.
Even fundamentally so: Monad axioms have more type parameters than 
monoid axioms, so they cannot be made isomorphic by clever transformations.

>> There's also a final argument: If monad and monoid are really the same,
>> why do mathematicians still keep the separate terminology?
> 
> Because they are different, as we hopefully agree.

We do :-)

Regards,
Jo


More information about the Haskell-Cafe mailing list