At 20:50 97/05/08, Koen Claessen wrote:
>.. Haskell, however, doesn't specify any relationship
>between Monad's and Functor's. This a problem.
..
>Monads play such an important role nowadays in Haskell-like languages,
>that it is important to get its definition right.
It is clear that, even modeled on category theory, the monads used in
computers are only approximations of the mathematical objects, and further
I think one do gets punished by this lack of rigour. But one cannot assume
that mathematical objects (like monads) are correctly designed for use in
computers.
>The solution is real easy: To express the necessity of a Monad to be a
>Functor, change the definition of the class Monad as follows:
>
> class Functor m => Monad m where
> ...
Monads, however, are not functors, but triples
(M, iota, mu)
where M: C -> D is a functor between categories C, D. Deliberate
mathematical notational sloppiness makes one to write M for the whole monad
(just as a group is a triple (G, e, *) satisfying certain axioms, which one
then simply calls G).
(You have to sort it out how it works out in Haskell -- I do not think it
is very easy.)
Hans Aberg