fram-lang/dbl

Non-exhaustive pattern-matching as a warning instead of error

Open

#210 opened on Apr 2, 2025

View on GitHub
 (4 comments) (0 reactions) (0 assignees)OCaml (28 forks)auto 404
2.1. pattern-matchingerror messagesgood first issue

Repository metrics

Stars
 (46 stars)
PR merge metrics
 (PR metrics pending)

Description

Non-exhaustive pattern-matching could be optionally considered a warning. Such a behavior of the type-checker would simplify prototyping in Fram. For not-matched cases we could generate a call to built-in function "dbl_runtimeError", maybe even showing the counterexample of not-matched pattern. There is a minor design decision on what to do with non-exhaustive pure pattern-matching. Raising runtime-error should be considered as an effect [] (NTerm in Core), so I think, non-exhaustive pure pattern-matching should be an error.

Contributor guide