aristanetworks / aristanetworks/purescript-backend-optimizer

Add option to remove pattern match failure assertions

Open
#80 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PureScript
Stars
216
Forks
24
Avg merge
8m
Merged PRs (30d)
2

Description

In line with the main compiler, we insert pattern match failure assertions (`$runtime.fail()`) when there is no wildcard pattern. Since the pattern matching tree optimizer emits complete if/else trees, we should be able to omit the assertion when a branch covers all tags for a given `ProperName`.

This failure assertion is potentially useful for catching foreign errors sneaking through, so I think this could be an option like `--int-tags`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the pattern matching tree optimizer and the command-line option handling associated with the main compiler and `--int-tags`. Trace where `$runtime.fail()` is emitted for branches without wildcard patterns. Done means the new option controls whether assertions are omitted for complete tag coverage while retaining the option to catch foreign errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.