parsec
parsec copied to clipboard
Why does Parsec change the fixity of `<|>`?
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?
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.
It actually is an instance of Alternative. All we need to do is remove the fixity declaration and function definition from Prim.hs.
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.