categories and monoids (was: Re: [Haskell-cafe] Design Patterns by Gamma or equivalent)

Wolfgang Jeltsch g9ks157k at
Tue Mar 17 08:06:10 EDT 2009

Am Dienstag, 17. März 2009 10:54 schrieben Sie:
> Wolfgang Jeltsch <g9ks157k at> writes:
> > By the way, the documentation of Control.Category says that a category is
> > a monoid (as far as I remember). This is wrong. Category laws correspond
> > to monoid laws but monoid composition is total while category composition
> > has the restriction that the domain of the first argument must match the
> > codomain of the second. 
> I'm reading the Barr/Wells slides at the moment, and they say the
> following:
> "Thus a category can be regarded as a generalized monoid,

What is a “generalized monoid”? According to the grammatical construction 
(adjective plus noun), it should be a special kind of monoid, like a 
commutative monoid is a special kind of monoid. But then, monoids would be 
the more general concept and categories the special case, quite the opposite 
of how it really is.

A category is not a “generalized monoid” but categories (as a concept) are a 
generalization of monoids. Each category is a monoid, but not the other way 

A monoid is clearly defined as a pair of a set M and a (total) binary 
operation over M that is associative and has a neutral element. So, for 
example, the category of sets and functions is not a monoid. First, function 
composition is not total if you allow arbitrary functions as its arguments. 
Second, the collection of all sets is not itself a set (but a true class) 
which conflicts with the above definition which says that M has to be a set.

> or a 'monoid with many objects'"

What is a monoid with many objects?

Best wishes,

More information about the Haskell-Cafe mailing list