
2 May
2012
2 May
'12
2:38 a.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