Title: Make default-pack directives monotone: gate saturated pastes without vetoing the heuristics · Issue #330 · purescript-lua/purescript-lua · GitHub
Open Graph Title: Make default-pack directives monotone: gate saturated pastes without vetoing the heuristics · Issue #330 · purescript-lua/purescript-lua
X Title: Make default-pack directives monotone: gate saturated pastes without vetoing the heuristics · Issue #330 · purescript-lua/purescript-lua
Description: Problem An arity=N directive replaces the built-in heuristics for its target everywhere: the name is pasted at sites applying at least N arguments, and vetoed at every other decision point — the uncurry split, whole-binding inlining, and...
Open Graph Description: Problem An arity=N directive replaces the built-in heuristics for its target everywhere: the name is pasted at sites applying at least N arguments, and vetoed at every other decision point — the un...
X Description: Problem An arity=N directive replaces the built-in heuristics for its target everywhere: the name is pasted at sites applying at least N arguments, and vetoed at every other decision point — the un...
Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/330
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make default-pack directives monotone: gate saturated pastes without vetoing the heuristics","articleBody":"## Problem\n\nAn `arity=N` directive replaces the built-in heuristics for its target everywhere: the name is pasted at sites applying at least N arguments, and vetoed at every other decision point — the uncurry split, whole-binding inlining, and the dictionary-projection resolution. That totality is right when a user wrote the directive (it expresses intent), but the default pack (#242) is compiler-shipped, and at sites the heuristics handled better the pack now forces a worse shape. Concrete instance from PR #327, `Golden.ArrayOfUnits.Test/golden.lua`: inside the Effect functor dictionary, `map = liftA1` contains `pure applicativeEffect`; the heuristics used to chase that projection to the stored field value, emitting the direct reference `Effect_pureE(f)`, but under the pack's `Control.Applicative.pure arity=1` the site pastes to the field read `Effect_applicativeEffect.pure(f)` and stops — the Effect dictionaries are a lazily-tied recursive knot the projection resolver cannot look through after the paste. Same family: `Golden.StringCodePoints` +2% from rematerialized wrappers, `Golden.Issue37` and `Golden.CprState` shifting a few bytes each. During pack calibration, roughly twenty candidate entries (comparison operators, numeric accessors, `Control.Monad.ap`) had to be dropped for regressing the corpus this way, so the strict semantics also caps how much of the prelude the pack can safely cover.\n\n## Approach\n\nTrack directive provenance in `InlinePolicy`: entries sourced from the default pack contribute the saturated-paste rule (`inlineSaturatedCall`) but do not join `uncurryVeto` and do not veto the heuristic paths, so wherever the heuristics previously produced a better shape they still fire. Explicit sources — module-header pragmas and the `--directives` file — keep today's strict semantics unchanged. The pack becomes monotone by construction: with it enabled the output is never worse than without it.\n\n## Prerequisites / Relations\n\nFollow-up to #242 / PR #327. Would let the entries dropped during #327's calibration be reconsidered, and de-risks extending the pack to more libraries.\n\n## Verification / Measurement\n\nProperty at corpus level: with the soft tier, no golden.lua grows relative to a pack-disabled build (assert by diffing a mempty-pack compile against the shipped-pack compile in the harness); the `ArrayOfUnits` line returns to `Effect_pureE(f_S_1)`; all present wins retained byte-for-byte; eval goldens unchanged.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-28T10:15:53Z","url":"https://github.com/purescript-lua/purescript-lua/issues/330"}
| 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:4c096c49-52ea-85ed-2bdd-d3e5bec14861 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E95E:117C62:6B4D2D:910EC5:6B00D93E |
| html-safe-nonce | 2fa89e4af7a82e780ddf7c196fb2ea6b45d8c17be029d70a47fa7f67112bbbe6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTVFOjExN0M2Mjo2QjREMkQ6OTEwRUM1OjZCMDBEOTNFIiwidmlzaXRvcl9pZCI6IjY3NTE1NjYwMjEzMzA1MjQ0NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d4d2b9156891bc4a76b0a002cd798eae39f35cd6a07620d8a6086d87b2652f17 |
| hovercard-subject-tag | issue:4997434317 |
| 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/330/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ba4ea7217845570616c8a68388f116093feb833b0fe4a9b1ee8852ee2a7db441/purescript-lua/purescript-lua/issues/330 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ba4ea7217845570616c8a68388f116093feb833b0fe4a9b1ee8852ee2a7db441/purescript-lua/purescript-lua/issues/330 |
| og:image:alt | Problem An arity=N directive replaces the built-in heuristics for its target everywhere: the name is pasted at sites applying at least N arguments, and vetoed at every other decision point — the un... |
| 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