RE: [Haskell-cafe] Parser problem continued

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.
No, that still gives the same undefined variable error. :( Nik Dr Nik FreydĂs Whitehead University of Akureyri, Iceland ********************************************************************* Having the moral high ground is good. Having the moral high ground and an FGMP-15 is better. *********************************************************************

On Tue, Mar 15, 2005 at 03:44:55PM -0000, Nicola Whitehead wrote:
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.
No, that still gives the same undefined variable error. :(
Sometimes I prefer to write such code in a lispy way: expr = do t <- term ((+++) (do symbol "+" e <- expr return (t+e)) (return t)) Best regards Tomasz
participants (2)
-
Nicola Whitehead
-
Tomasz Zielonka