Pregunta

Soy un novato en Haskell. Estoy intentando compilar este archivo Haskell he descargado, pero me está dando algunos errores.

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 "_"

No estoy seguro si esto es suficiente, pero aquí está la sección del código con el error:

parseIdent = do { str <- indent
                ; return (makeIdent str)
                } <?> "identifier"
  where firstAllowed = oneOf "_" <|> letter
¿Fue útil?

Solución

En la parte que se citan no parece ser utilizado en cualquier lugar de la función firstAllowed local. ¿Qué ocurre si se quita la línea where?

Si lo prefiere puede tratar de añadir este tipo de firma a firstAllowed:

 where
    firstAllowed :: Stream s m Char => ParsecT s u m Char
    firstAllowed = ...
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top