Library report, monad zero laws

Jon Fairbairn Jon.Fairbairn@cl.cam.ac.uk
Fri, 21 Jun 2002 15:02:16 +0100


> On Fri, Jun 21, 2002 at 12:50:21PM +0100, Simon Peyton-Jones wrote:
> > | From: Jon Fairbairn [mailto:Jon.Fairbairn@cl.cam.ac.uk] =

> > | Sent: 20 June 2002 16:27
> > | To: Simon Peyton-Jones
> > | Subject: Library report, monad zero laws
> > | =

> > | The old report used to include =

> > | =

> > |  m >> zero =3D zero
> > |  zero >>=3D m =3D zero
> > |  m ++ zero =3D m
> > |  zero ++ m =3D m
> > | =

> > | after the other monad laws. Now mzero and mplus are in the =

> > | library, shouldn't there be some mention of these laws there? =

> > |  I'd be particularly keen to see a remark about =

> > | =

> > |  _|_ >> zero =

> > | =

> > | inevitably being _|_
> =

> Would you put that next to m >> zero =3D zero ?

Well, that's rather the point. At the moment the library
report just says "The class methods mzero and mplus are the
zero and plus of the monad.", which implies m >> zero =3D
zero, but it can't be.

-- =

J=F3n Fairbairn                                 Jon.Fairbairn@cl.cam.ac.u=
k
31 Chalmers Road                                         jf@cl.cam.ac.uk
Cambridge CB1 3SZ            +44 1223 570179 (after 14:00 only, please!)