pure
pure copied to clipboard
Extend PureLang `cexp` with annotations
Add an Annot form to cexp as follows:
annot = Inline mlstring | ...
cexp = ... | Annot annot cexp
This should desugar as follows: exp_of (Annot _ ce) = exp_of ce.
Discussion in meeting:
Annotation types: annot = NoInline | Inline | Inlineable | ConLike | InlineHere mlstring | ...
- For top-level functions, expect annotations to be introduced on RHS, i.e.
Let x (Annot Inline e1) e2. This means that annotations appear around lambdas, so the inliner needs to ensure it looks underAnnotwhen considering arities. - Pragmas to support
- Top-level pragmas mirroring GHC:
{-# INLINEABLE f #-},{-# INLINE f #-},{-# NOINLINE f #-},{-# CONLIKE #-} - Special function for inlining at a specific call-site:
#(__inline), akin to GHC'sinline -
{-# INLINE_IN_SCOPE f #-}(or similar): a variant of#(__inline)which applies to the current scope, i.e. wrap the entire scope in anInlineHere <name>expression
- Top-level pragmas mirroring GHC: