Skip to content

Fix issues caused by making <|> infixr #161

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

Closed
JordanMartinez opened this issue Mar 23, 2022 · 1 comment · Fixed by #163
Closed

Fix issues caused by making <|> infixr #161

JordanMartinez opened this issue Mar 23, 2022 · 1 comment · Fixed by #163
Labels
purs-0.15 A reminder to address this issue or merge this PR before we release PureScript v0.15.0 type: breaking change A change that requires a major version bump.

Comments

@JordanMartinez
Copy link
Contributor

Fix issues caused by making <|> right associative

[1/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Expr.purs:58:5

  58      <?> "operator"
          ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[2/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:442:45

  442    characterChar = charLetter <|> charEscape <?> "literal character"
                                                   ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[3/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:840:58

  840        skipMany (simpleSpace <|> multiLineComment langDef <?> "")
                                                                ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[4/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:867:5

  867      <?> "end of comment"
           ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[5/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:877:5

  877      <?> "end of comment"
           ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.
@JordanMartinez JordanMartinez added type: breaking change A change that requires a major version bump. purs-0.15 A reminder to address this issue or merge this PR before we release PureScript v0.15.0 labels Mar 23, 2022
@natefaubion
Copy link
Contributor

The precedence of this operator is really odd, I think it should probably be at level 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
purs-0.15 A reminder to address this issue or merge this PR before we release PureScript v0.15.0 type: breaking change A change that requires a major version bump.
Development

Successfully merging a pull request may close this issue.

2 participants