-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semantic-based optimization for untagged variants. #6108
Comments
The idea here is that semantic-based optimizations could simplify the generated code without adding additional complexity to the already complex pattern matching compiler. |
Should beware of being broken by JS data types that are not yet handled, such as |
Got an example of what's currently broken because of that? |
* Example of complex pattern for untagged variant. From #6108 * Some simplification. * More optimization * Optimize "or". * Update CHANGELOG.md
There seems to be a few opportunities for semantic-based optimization for the compiler.
Here's an example of code generated via the new untagged variants functionality:
Notice for example
if (!(match instanceof Array) && typeof match !== "object" && typeof match !== "number" && typeof match !== "string" && match === true) {
that could be justif (match === true)
.cc @cristianoc
The text was updated successfully, but these errors were encountered: