Usando umof em haskell, erros na compilação
Pergunta
Sou um novato completo em Haskell. Estou tentando compilar esse arquivo haskell que baixei, mas está me dando alguns erros.
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 "_"
Não tenho certeza se isso é suficiente, mas aqui está a seção do código com o erro:
parseIdent = do { str <- indent
; return (makeIdent str)
} <?> "identifier"
where firstAllowed = oneOf "_" <|> letter
Solução
Na parte você citou o local firstAllowed
A função não parece ser usada em nenhum lugar. O que acontece se você remover o where
linha?
Como alternativa, você pode tentar adicionar esta assinatura a firstAllowed
:
where
firstAllowed :: Stream s m Char => ParsecT s u m Char
firstAllowed = ...
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow