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.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe