On Zulip, Peter Nelson reported that notations that could be pretty printed with generalized field notation did not pretty print using the intended notation.
This PR makes it so that app unexpanders are considered before generalized field notation. The complexity before was that we wanted to do parent projection collapse, and since we did the collapse before pretty printing that argument, it meant it wasn't possible to do app unexpanders when there was a field notation candidate. The new solution is to collapse parent projections only when actually considering field notation, which can be done because we can safely strip off projection syntax in an expression-directed way.
On Zulip, Peter Nelson reported that notations that could be pretty printed with generalized field notation did not pretty print using the intended notation.
This PR makes it so that app unexpanders are considered before generalized field notation. The complexity before was that we wanted to do parent projection collapse, and since we did the collapse before pretty printing that argument, it meant it wasn't possible to do app unexpanders when there was a field notation candidate. The new solution is to collapse parent projections only when actually considering field notation, which can be done because we can safely strip off projection syntax in an expression-directed way.