
15 Mar
2005
15 Mar
'05
10:39 a.m.
expr :: Parser Int expr = do t <- term do symbol "+" e <- expr return e return (t + e) +++ return t <-----
't' is not in scope at the arrow. t only exists inside the do block, and your code parses like this ( do t <- .... return (t+e) ) +++ ( return t ) perhaps like this: expr = do t <- term (do symbol "+" e <- expr return (t+e) ) +++ (return t) although I think you may also want a 'try' before the first alternative.