Skip to content

Add inline annotation for data types #72

@natefaubion

Description

@natefaubion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions