>The monad laws in the report are an aid to understanding the
>relationships between the monadic functions.  I don't think any
>Haskell compiler attempts to optimize method calls based on laws (or
>whatever you want to call them) that would constrain the behavior of
>all instances of a particular class.  The report states that new
>monadic instances `should' obey the given laws, but only at the
>expense of confusing users.
>
>The next report could certainly add or modify these laws to make this
>section clearer.
>

Yes, maybe there should be a whole separate section on 'nonobligatory but
desirable' laws for all classes. Including the arithmetic ones e.g. those
held by div, rem, etc. and even such things like 1 behaving as a unit of
multiplication. Of course computer hardware doesn't implement arithmetic
according to the strict mathematical laws of Rings, Fields ... but it would
still be useful to indicate what was desirable.


                                                     _____
                                                    /    /\
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