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

Why does Parsec change the fixity of <|>? #61

Open
jwiegley opened this issue Oct 11, 2016 · 3 comments
Open

Why does Parsec change the fixity of <|>? #61

jwiegley opened this issue Oct 11, 2016 · 3 comments

Comments

@jwiegley
Copy link

In Control.Applicative, <|> is defined as having fixity infixl 3, but in Parsec it is defined as infixr 1. Is there a reason for this difference? Should Parsec be changed to match?

@mrkkrp
Copy link
Contributor

mrkkrp commented Oct 11, 2016

I believe it's this way because Parsec had (<|>) before Control.Applicative became common, so it has chosen its own standards. IMO, not only precedence should be changed to match, but it should also be made an instance of Alternative and (<|>) should be just re-exported from Control.Applicative. That's what we've done in Megaparsec.

@jwiegley
Copy link
Author

It actually is an instance of Alternative. All we need to do is remove the fixity declaration and function definition from Prim.hs.

@mrkkrp
Copy link
Contributor

mrkkrp commented Oct 11, 2016

Ah, all right then. I would say we also need to re-export things from Control.Applicative. You can open a PR and it may be merged someday.

@hvr hvr added this to the 3.2 (breaking change) milestone Jun 22, 2017
@hvr hvr added the pvp:major label Jun 22, 2017
@hvr hvr removed this from the 3.2 (breaking change) milestone Jun 22, 2017
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
Projects
None yet
Development

No branches or pull requests

3 participants