You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
0 commit comments