[Haskell-cafe] What are the MonadPlus laws?
iavor.diatchki at gmail.com
Wed Jan 26 13:37:36 EST 2005
On Tue, 25 Jan 2005 22:49:06 -0500, Paul Hudak <paul.hudak at yale.edu> wrote:
> Good point; I suppose the constraint m /= _|_
> should be added to the law.
This is not enough, at least in some cases.
Consider lists, and m being an infinite list, e.g. [1..]
Then we need that the inifinte concatenation of a empty lists
gives us the empty list which is not the case.
> ajb at spamcop.net wrote:
> > The problem is this "law":
> > m >>= \k -> mzero === mzero
> > I think this "law" is untrue for _all_ MonadPlus instances, and you can
> > trivially check this by setting m to bottom.
> > Cbheers,
> > Andrew Bromage
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe