
On 19 March 2010 04:35, 国平张
Sorry to bother again. I just cannot figure out how it could compile. I got compile errors. Can someone point out what is right code to use a do notion to make a Parser works.
It looks like the p parser may have the wrong indentation - although this might be due to either your mail client or my client formatting wrongly: p :: Parser (Char,Char) p = do x <- item item y <- item return (x,y) Try - with white space all aligned to the start character /x/ of the first statement in the do: p :: Parser (Char,Char) p = do x <- item item y <- item return (x,y) Or with braces and semis: p :: Parser (Char,Char) p = do { x <- item ; item ; y <- item ; return (x,y) } Best wishes Stephen