haskell / haskell/parsec

Parsec returns additional, spurious error messages on parserFail

Open
#91 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
892
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Consider the following code entered in ghci:

Parsec.parse (Parsec.many1 Parsec.digit <* Parsec.parserFail "foo") "" "123"

Here is the result:

Left (line 1, column 4):
unexpected end of input
expecting digit
foo

The error messages "unexpected end of input" and "expecting digit" should not be there.

This is simplified from a more involved example in which the result of parsing a number is checked, and parserFail is called if the number is out of bounds.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.