Title: Directive `default` cannot opt a binding out of derived inline directives · Issue #325 · purescript-lua/purescript-lua · GitHub
Open Graph Title: Directive `default` cannot opt a binding out of derived inline directives · Issue #325 · purescript-lua/purescript-lua
X Title: Directive `default` cannot opt a binding out of derived inline directives · Issue #325 · purescript-lua/purescript-lua
Description: Problem Directive derivation (#241) gives specialization bindings — top-level bindings applying an @inline arity=N target to some of its arguments — a derived policy: arity=(N-k) while under-applied, always-inline once saturated. The der...
Open Graph Description: Problem Directive derivation (#241) gives specialization bindings — top-level bindings applying an @inline arity=N target to some of its arguments — a derived policy: arity=(N-k) while under-applie...
X Description: Problem Directive derivation (#241) gives specialization bindings — top-level bindings applying an @inline arity=N target to some of its arguments — a derived policy: arity=(N-k) while under-applie...
Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/325
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Directive `default` cannot opt a binding out of derived inline directives","articleBody":"## Problem\n\nDirective derivation (#241) gives specialization bindings — top-level bindings applying an `@inline arity=N` target to some of its arguments — a derived policy: `arity=(N-k)` while under-applied, always-inline once saturated. The derivation skips any binding carrying an explicit root directive (`never`/`always`/`arity=N`), but a written `default` cannot serve as that opt-out: `resolveModes` (the directive-precedence resolver in `Language.PureScript.Backend.IR.Inliner`) folds a winning `default` mode to no annotation before translation, so by the time `derivedInlinePolicy` inspects the uber-module the binding is indistinguishable from an unannotated one and derivation proceeds. The only working opt-out today is `never`, which is stronger than intended — it also pins the binding against every other paste path.\n\n## Approach\n\nFirst decide the semantics, then plumb it. The README defines `default` as \"resets the target to the built-in heuristics\", and derivation can be read as part of the heuristics — under that reading current behavior is correct and the gap is expressiveness only. The leaning is the other way: an explicit directive naming a specific binding expresses intent about that binding, so `default` should also mask derivation. Implementation once decided: preserve the mask through translation — either a `Default` constructor on `Annotation` that `collectInlinePolicy` gathers into a `policyDefault ∷ Set QName` and that every other consumer treats as no annotation, or a masked-target set threaded from `mkModule` through the linker — and consult it in the `hasRootDirective` guard of `derivedInlinePolicy`.\n\n## Prerequisites / Relations\n\nBuilds on #241 (derived directives) and the #232 directive DSL. Independent of the #242 directive pack.\n\n## Verification / Measurement\n\nA pipeline spec: a specialization of an `arity=N` target annotated `@inline spec default` keeps its call sites calling the shared binding (no derived paste), while an unannotated sibling specialization still derives. Directive-source precedence (local pragma vs file vs export) over the `default` entry stays as documented.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-28T07:48:34Z","url":"https://github.com/purescript-lua/purescript-lua/issues/325"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aff2dd83-67d8-482a-3111-df5a3a51177b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E24E:4E0A:151DA0:1AF2AB:6B00D94A |
| html-safe-nonce | db3490a596b778be5f1d9ed3f4ca2e4bdc25cd8babab6f349e46a823a4900ab8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjRFOjRFMEE6MTUxREEwOjFBRjJBQjo2QjAwRDk0QSIsInZpc2l0b3JfaWQiOiI2MDQwOTQ2NDAzNTUzODkyNjgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 594df9aed6dc99713f4dc26baad8a8748def8e2044e6a45216385ceb9a1e2557 |
| hovercard-subject-tag | issue:4996239229 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-lua/purescript-lua/325/issue_layout |
| twitter:image | https://opengraph.githubassets.com/899215fac3f92642c6cc56ef6c9a87e1a0a484154996de1017545727b02566ff/purescript-lua/purescript-lua/issues/325 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/899215fac3f92642c6cc56ef6c9a87e1a0a484154996de1017545727b02566ff/purescript-lua/purescript-lua/issues/325 |
| og:image:alt | Problem Directive derivation (#241) gives specialization bindings — top-level bindings applying an @inline arity=N target to some of its arguments — a derived policy: arity=(N-k) while under-applie... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Unisay |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| turbo-cache-control | no-preview |
| go-import | github.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git |
| octolytics-dimension-user_id | 131581790 |
| octolytics-dimension-user_login | purescript-lua |
| octolytics-dimension-repository_id | 587200487 |
| octolytics-dimension-repository_nwo | purescript-lua/purescript-lua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587200487 |
| octolytics-dimension-repository_network_root_nwo | purescript-lua/purescript-lua |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width