Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix printing braces in effects #385
I just had one question — I haven't fully grokked when it's necessary to pass 0 or 3 to
Is having the parentheses around
That number is the “ambient precedence” - generally you only want to put parens if the immediately surrounding expression has higher precedence. The general idea is this ambient precedence follows the precedence of the parser, so the prettyprinter prints things with a minimum of parens needed to produce the same AST.
In this case, the parens inside the ability list are redundant so I think it’s right to pass 0 as the ambient precedence.
Hope that is helpful!