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
Implement mkParsec—a new method of MonadParsec #514
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to use Reply
? It seems that your type of liftConsumer is isomorphic to
(State s e -> Reply s e a) -> m a
and implementation of pLiftConsumer
is identical to mkPT
.
I wasn't aware of Reply :)
|
@brandonchinn178 So, first of all, I'm sorry it took so long to get to this one. This is a great idea which I believe can greatly empower users of the library. Regarding @Lev135's suggestion, I think it is a very good one. I sketched an alternative implementation and pushed it to this branch (I also took the liberty of rebasing on current I did not implement |
Looks great! Yeah, if you get the breakOn test working, that's sufficient for me! |
This can be used to construct “new primitives” with arbitrary behavior at the expense of having to dive into Megaparsec's internals.
Close #366.
Implements a new primitive as discussed in #366 (comment), which enables defining new primitives, at the cost of needing to drop (a little) into megaparsec internals.