Pretty-print infix constructors in pattern counterexamples using infix notation
When pattern matching is non-exhaustive, the compiler shows a counterexample. Currently, infix constructors like :: are printed in prefix notation with excessive parentheses:
fatal error: This pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
(::) _ ((::) _ _)
This should be printed as:
Details
- Infix constructors are stored internally as
"(::)" (parentheses-wrapped)
- Precedence is determined by first character (
: -> level 70, + -> 80, * -> 90, etc.)