![]() | drunken-monad identity monad example |
|
06 Mar 2011, 05:42
Leo (2 posts) |
in looking at the body of the treasureMap function on page 304 (“Building a Monad from Scratch”), I am trying to figure out how to parse the expression:
how is this parsed by GHC? (right associative or left associative >>==)
or like this(left associative >>==)?
The first(right-associative) would seem to transform like so: I think I fudged it a bit to make the parentheses work right. My confusion is, for example, in step : Thanks for your help |
|
06 Mar 2011, 07:12
Leo (2 posts) |
ok, I can see it’s left associative. Does this look right? I’m unsure how many parentheses to keep around? specifically whether to put an expression like stagger(pos) in parentheses, making it (stagger(pos)). form 0:
(((pos >>==
stagger)>>==
stagger)>>==
crawl)>>==
rtn |
| You must be logged in to comment |

