Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No instance for (Text.Parser.Combinators.Parsing Parser) arising from a use of `unexpected' #72

Closed
freeman42x opened this issue Apr 3, 2018 · 1 comment

Comments

@freeman42x
Copy link

How to reproduce:

checkout unexpected-bug-example branch from this fork: https://github.com/razvan-panda/parsers/tree/unexpected-bug-example

stack init
stack test

Causes following error:

[1 of 2] Compiling SemVer           ( tests/SemVer.hs, .stack-work/dist/x86_64-linux-nix/Cabal-2.0.1.0/build/quickcheck/quickcheck-tmp/SemVer.o )
            
/home/neo/Forks/parsers/tests/SemVer.hs:13:10: error:
    * No instance for (Text.Parser.Combinators.Parsing Parser)
        arising from a use of `unexpected'
    There are instances for similar types:
        instance Data.Attoparsec.Internal.Types.Chunk t =>
                Text.Parser.Combinators.Parsing
                (Data.Attoparsec.Internal.Types.Parser t)
        -- Defined in `Text.Parser.Combinators'
    * In the expression: unexpected "Leading Zeros"
    In a stmt of a 'do' block:
        if length digits > 1 && head digits == '0' then
            unexpected "Leading Zeros"
        else 
            return $ read digits
    In the expression:
        do digits <- some digit
        if length digits > 1 && head digits == '0' then
            unexpected "Leading Zeros"
        else
            return $ read digits
|         
13 |     then unexpected "Leading Zeros"
|
@RyanGlScott
Copy link
Collaborator

This is a Cabal issue, not a parsers issue. The advice in #73 (comment) contains a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants