
1 May
2012
1 May
'12
10:38 p.m.
Hello. I want a parser to parse arithmetic expressions using Parsec-3.1.2. Therefore I wrote the attached Haskell module. But its compilation with ghc-7.4.1 fails with the message: Expr1.hs:22:22: No instance for (Stream s0 m0 Char) arising from a use of `pLexeme' Possible fix: add an instance declaration for (Stream s0 m0 Char) In the second argument of `(<$>)', namely `pLexeme (many1 (satisfy isDigit))' In the expression: read <$> pLexeme (many1 (satisfy isDigit)) In an equation for `pNum': pNum = read <$> pLexeme (many1 (satisfy isDigit)) Any clues on how to fix this? Romildo