Talk:Haskell/Alternative and MonadPlus

The diagram in the guard section
Pardon my ignorance, but shouldn't that tree under the 'guard' section look like this?

start |____________________________________________ ...   |                     |                    | x  1                     2                    3 |_______________ ... |_______________ ... |_______________ ...    |      |      |       |      |      |      |      |      | y  1      2      3       2      3      4      3      4      5 |___...|___...|___... |___...|___...|___...|___...|___...|___...   | | |  | | |  | | |   | | |  | | |  | | |  | | |  | | |  | | | z  1 2 3  2 3 4  3 4 5   2 3 4  3 4 5  4 5 6  3 4 5  4 5 6  5 6 7


 * It looks like you're right. Maybe we should see what DavidHouse thinks... I suppose after a while, we should just go ahead and replace that diagram -- Kowey 13:17, 6 December 2006 (UTC)


 * (I'm pretty sure) he's right -- Felix C. Stegerman 08:35, 10 June 2007 (UTC)

Also, the 'guard' section contains:


 * So the empty list produced by the call to  in the binding of   will cause   to be the empty list, and therefore   to be the empty list.

The way I see it, since  evaluates to   (the empty list),   is never called in (what evaluates to). Which means it should be (something like):


 * So the empty list produced by the call to  in the binding of   will cause   to be the empty list.  I.e.   evaluates to , which evaluates to  ).    is never called.

(feel free to rephrase that)

-- Felix C. Stegerman 09:08, 10 June 2007 (UTC)


 * To provide long overdue closure on this discussion: both the diagram here and the one in the original chapter are wrong, to the extent they do not reflect how  is actually calculated. A more appropriate diagram is now on that page. As for the   issue, I have rephrased that in the spirit of your suggestion. Thanks for highlighting the issue. --Duplode (discuss • contribs) 19:19, 20 November 2016 (UTC)

On the guard section diagram
Uhm, I was wondering maybe this sentence "we need a branch starting from the top for every choice of z, then a branch from each of these branches for every value of x, then from each of these, a branch for every value of y." has some problems? According to the scheme below, shouldn't we branch x first, then y then z?

Sqdcn (discuss • contribs) 13:45, 24 April 2016 (UTC)


 * The diagram was wrong -- not just due to the x/y/z issue, but also the numbering didn't match the  definition. The chapter was just rewritten, and this issue is now fixed. --Duplode (discuss • contribs) 18:17, 20 November 2016 (UTC)