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

the name of notFollowedBy is not consistent with the semantics of the other parsers #92

Open
danse opened this issue Apr 20, 2018 · 2 comments

Comments

@danse
Copy link

danse commented Apr 20, 2018

Just a small thing if you want, i'm pointing this out while approaching Parsec, before getting used to this.

Usually a parser's name refers to the current parser input. char 'a' will parse 'a' and so on.

If we read notFollowedBy with the same semantics, a parser like notFollowedBy '.' should correctly parse "." because "." is not followed by a dot. It should fail for "a.", instead.

In this sense a parser called notFollowedBy should probably get two parsers as arguments, like manyTill etcetera. I find that the current semantic of notFollowedBy is closer to a simple not.

@barufa
Copy link
Contributor

barufa commented Feb 24, 2019

I think that you are right, but modifying it might cause a lot of problem and bugs in projects that use it because this new behavior would be different.
I am not sure that modifying notFollowedBy is a good idea.

@danse
Copy link
Author

danse commented Feb 25, 2019

Thanks for following up @barufa. First of all we can agree whether we like the interface or whether we think that there is room for improvement. Once we agree that we want to improve, we can find a way towards it. For example an alias of notFollowedBy could be introduced and, if we like the resulting semantic, notFollowedBy could be deprecated in a couple of years. Even if no change is going to happen, it can be helpful to discuss about the clearest semantic so that other function names can follow a schema and the parser can become more approachable. First of all let's wait for more people to chime in :)

int-index pushed a commit to int-index/parsec that referenced this issue Sep 18, 2020
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

No branches or pull requests

2 participants