fram-lang / fram-lang/dbl

Pretty-print infix constructors in pattern counterexamples using infix notation

Open
#325 0 comments 0 reactions 0 assignees View on GitHub
error messages good first issue
Dominant language
OCaml
Stars
45
Forks
28
PR merge metrics
No merged PRs in 30d

Description

## 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.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.