Koen Claessen wrote:

>Tony Davie wrote:
>
> | >    class Monad m where
> | >        map :: (a -> b) -> (f a -> f b)       -- Functor
> | >        return :: a -> m a                    -- Unit
> | >        (>>=)  :: m a -> (a -> m b) -> m b    -- Kleisli multiplication
> | >     or join   :: m(m a) -> m a               -- Monoid multiplication
> | >        -- Some axioms are missing here.
> |
> | I'm really worried about whether ordinary mortals (or at any rate
> | programmers) will not be put off by these terms.
>
>What terms do you mean?
>
>For the programmer only _using_ Monads, nothing changes.
>
>As stated earlier, we can get rid of the "map" part by defining Functor as
>a superclass. Further, "join" can have a default definition in terms of
>"map" and ">>=". For the programmer nothing changes, (s)he still only has
>to define ">>=" and "return".
>
>Not to mention the fact that the programmer now actually has the choice
>of:
>
>  - or defining map, join and return;
>  - or defining map, >>= and return.
>
>As I stated earlier, I (and I think also others) find it often easier to
>define "join" than ">>=".
>
> | It's all very well for mathematicians. Do we have to be mathematicians to
> | make use of monoidal programming ideas?
>
>I don't know what you mean by this. The addition of join to the Monad
>class has no effect on the user of Monads, and increases possibilities for
>programmers defining Monads. Does that make us mathematicians? What does
>that imply? What is the cause of that?
>

What I am trying to say is that it would appear that to make effective use
of the Haskell class structure vis-a-vis monads, one needs to know about
several category theoretical concepts in addition to monads themselves,
Functors, Monoids and Kleisli multiplication. I personally have never heard
of the last of these three.

The idea of 'generalised binding' is clearly of interest to programmers but
I'm increasingly worried that in providing the structures present in
Haskell we haven't abstracted away enough from the underlying mathematics
to make it easy for programmers.

Well I suppose programming ISN'T easy, but our job as language designers is
supposed to make it more so.


                                                     _____
                                                    /    /\
Tony Davie                Computer Science         /    /  \
Tel: +44 1334 463257      St.Andrews University   /    /    \
Fax: +44 1334 463278      North Haugh            /    /  /\  \
[EMAIL PROTECTED]       St.Andrews            /    /  /  \  \
                          Scotland             /    /  /\   \  \
                          KY16 9SS            /    /  /  \   \  \
                                             /    /__/____\   \  \
                                            /              \   \  \
http://www.dcs.st-and.ac.uk/~ad/Home.html  /________________\   \  \
                                           \                     \  \
                                            \_____________________\ /

In theory, there is no difference between theory and practice, but
in practice there is a great deal of difference.




Reply via email to