-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve message produced by eitherResult for Partial
When a parser result is Partial, previously the eitherResult function showed a generic error message that includes no useful information other than a generic "incomplete input" message. For example, if we let p = (,) <$> letter <*> digit <?> "thing" then eitherResult (parse p "a") = Left "Result: incomplete input" Attoparsec is already capable of generating more informative error information for this example, as we can demonstrate by using parseOnly: parseOnly p "a" = "thing > digit: not enough input" This change brings that same error message to eitherResult by simply feeding `mempty` into the continuation. With this change, eitherResult now gives the same output as parseOnly. eitherResult (parse p "a") = "thing > digit: not enough input"
- Loading branch information
1 parent
71a67cb
commit 5678ad2
Showing
4 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters