Skip to content
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

Add inline annotation for data types #72

Open
natefaubion opened this issue Jul 23, 2023 · 0 comments
Open

Add inline annotation for data types #72

natefaubion opened this issue Jul 23, 2023 · 0 comments

Comments

@natefaubion
Copy link
Collaborator

One of the more powerful optimizations is case-of-case, which internally translates to the shouldDistributeBranches heuristic and the RewriteDistBranchesLet rewrite constraint. The problem is that it can result in exponential code explosion, so the heuristic is very conservative, with a hard cap on continuation size. The heuristic is mainly driven by the ResultTerm analysis, which can verify that all branches yield a known literal term. If as part of the analysis we noted which data type it resulted in (the constructor's ProperName field), we could support inlining annotations that force this optimization to apply whenever possible. Thus we could keep the heuristic conservative, but add annotations for things like Generics, so that the Generics intermediate representation more reliably fuses away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant