views:

139

answers:

1

Hi,

I'm a complete newbie at Haskell. I'm trying to compile this Haskell file I've downloaded but it's giving me some errors.

No instance for (Text.Parsec.Prim.Stream s m Char)
  arising from a use of 'letter' at Parse.lhs:649:26-31
Possible fix:
  add an instance declaration for (Text.Parsec.Prim.Stream s m Char)
In the first argument of '(<|>)', namely 'letter'
In the expression: letter <|> oneOf "_"
In the definition of 'firstAllowed':
  firstAllowed = letter <|> oneOf "_"

Not sure if this is enough, but here's the section of the code with the error:

parseIdent = do { str <- indent
                ; return (makeIdent str)
                } <?> "identifier"
  where firstAllowed = oneOf "_" <|> letter
+2  A: 

In the part you quoted the local firstAllowed function doesn't seem to be used anywhere. What happens if you remove the where line?

Alternatively you could try to add this type signature to firstAllowed:

 where
    firstAllowed :: Stream s m Char => ParsecT s u m Char
    firstAllowed = ...
sth
It's working after I remove the where line. Thanks!
Joelle