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

Add and_then combinator #28

Merged
merged 2 commits into from
May 1, 2015
Merged

Add and_then combinator #28

merged 2 commits into from
May 1, 2015

Conversation

Marwes
Copy link
Owner

@Marwes Marwes commented Apr 30, 2015

Intended to solve #22. I think the addition of the Other variant is an useful regardless but I am a bit vary of the and_then function since there is some overlap with then then function and I could also think of a third function which would have a signature like:

fn and_then<F, O>(self, f: F) -> AndThen<Self, F>
         where F: FnMut(Self::Input, Self::Output) -> ParseResult<O, Self::Input>;

`and_then` is intended to mirror the `and_then` function on `Result`. For parsers it can be used to a call a potentially failing operation on a parsed value easily.
@hawkw
Copy link
Contributor

hawkw commented Apr 30, 2015

Nifty, thanks!

Marwes added a commit that referenced this pull request May 1, 2015
@Marwes Marwes merged commit 57eea74 into master May 1, 2015
@Marwes Marwes deleted the box_error branch May 1, 2015 08:51
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

Successfully merging this pull request may close these issues.

2 participants