This adds a combinator that runs a fallible function f on the result of a parser p, like map_res, but returns a Failure instead of an Error if f fails. This is useful if a success on p means that you know for sure which branch you are in and there is no need to try any other branches if f fails.
This adds a combinator that runs a fallible function
f
on the result of a parserp
, likemap_res
, but returns aFailure
instead of anError
iff
fails. This is useful if a success onp
means that you know for sure which branch you are in and there is no need to try any other branches iff
fails.