fram-lang/dbl
View on GitHubNon-exhaustive pattern-matching as a warning instead of error
Open
#210 opened on Apr 2, 2025
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.