At 11:17 -0800 2000/03/11, Mark P Jones wrote:
>- The classes Functor and Monad should be merged into a single
>  class.  While every Monad is a Functor, you'd need to show that
>  the reverse holds too before you could merge the classes.  I'll
>  leave further exploration of that as an "exercise to the reader".

People get funny ideas about this, because even though the monad concept of
Haskell is picked directly out of category theory in mathematics, the
actual implementation fails to express certain aspects of the corresponding
mathematical concept.

So strictly speaking, a monad M is a triple (F, e, m), where F: C -> C is
an endo-functor, and e and m are certain natural transformations. These
three should hang together in such a manner that they form a monoid in the
monoidal category End(C) = Fun(C, C).

So it is also wrong to say that a monad M is a functor; this a false
impression given by the Haskell way to implement it.

Intuitively speaking, the monad represents a certain universal property
which is identified inside the category C as "M-algebras". The functor F
assigns any object A in C the corresponding _free_ M-algebra F(A).

So for example, for the group monad M_G inside the category of sets, F_G
assign to any set S the free group F_G(S), and so on. It is also via the
monad M_G possible to identify the category of groups inside the category
of sets via M_G as the subcategory of M_G-algebras; the latter is naturally
equivalent to the Kleisli category of M_G. The composition of the Kleisli
category is (essentially) the same as the multiplication used in the
Haskell monads.

  Hans Aberg


Reply via email to