Skip to content

Add tryRethrow #66

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

Merged
merged 2 commits into from
Jul 26, 2017
Merged

Add tryRethrow #66

merged 2 commits into from
Jul 26, 2017

Conversation

natefaubion
Copy link
Contributor

No description provided.


-- | Fail with a message and a position.
failWithPosition :: forall m s a. Monad m => String -> Position -> ParserT s m a
failWithPosition message position = throwError (ParseError message position)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to use this in fail or something? Currently seems unused within the library at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yeah :)

Copy link
Member

@garyb garyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@natefaubion
Copy link
Contributor Author

One other option may be to have a separate rethrow combinator, but it just results in more binds (which is why I baked in the try logic).

@paf31
Copy link
Contributor

paf31 commented Jul 26, 2017

👍 LGTM, thanks

@garyb garyb merged commit 0be7c39 into purescript-contrib:master Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants