Title: [fork-ffi] prelude: flip `@inline unit always` to `never` — inlining unit duplicates the singleton allocation · Issue #176 · purescript-lua/purescript-lua · GitHub
Open Graph Title: [fork-ffi] prelude: flip `@inline unit always` to `never` — inlining unit duplicates the singleton allocation · Issue #176 · purescript-lua/purescript-lua
X Title: [fork-ffi] prelude: flip `@inline unit always` to `never` — inlining unit duplicates the singleton allocation · Issue #176 · purescript-lua/purescript-lua
Description: Problem Data/Unit.purs in the purescript-lua-prelude fork opens with -- @inline unit always, added on the assumption that unit is the cheapest possible thing to inline. The assumption is inverted: the FFI value ({}) is a table constructo...
Open Graph Description: Problem Data/Unit.purs in the purescript-lua-prelude fork opens with -- @inline unit always, added on the assumption that unit is the cheapest possible thing to inline. The assumption is inverted: ...
X Description: Problem Data/Unit.purs in the purescript-lua-prelude fork opens with -- @inline unit always, added on the assumption that unit is the cheapest possible thing to inline. The assumption is inverted: ...
Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/176
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[fork-ffi] prelude: flip `@inline unit always` to `never` — inlining unit duplicates the singleton allocation","articleBody":"## Problem\n\n`Data/Unit.purs` in the purescript-lua-prelude fork opens with `-- @inline unit always`, added on the assumption that unit is the cheapest possible thing to inline. The assumption is inverted: the FFI value `({})` is a table *constructor*, so every inlined copy allocates a fresh table at runtime — e.g. an allocation per `void` step in Effect loops — where a reference to the foreign singleton allocates nothing. Seven inlined `{}` in the linked `Data.Array` output alone.\n\n## Approach\n\nChange the pragma to `-- @inline unit never` (or drop it) in the `Data/Unit.purs` FFI, release the fork, and bump the package set.\n\n## Prerequisites / Relations\n\nDepends on #175: the compiler must honor `never` for foreign export names before the pragma has any effect. And because #175 also makes table constructors never-duplicated by default, this flip becomes documentation of intent rather than the fix itself. Otherwise independent — a fork-side edit plus a release and package-set bump.\n\n## Verification / Measurement\n\nLinked output contains a single `{}` for unit; eval goldens unchanged — in particular `Array Unit` printing (the #23 class) must not move.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-06T09:54:24Z","url":"https://github.com/purescript-lua/purescript-lua/issues/176"}
| 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:9334dc4c-3bc2-92bd-b690-564af6a99609 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C99C:27D3AD:66D539:845AC5:6B00DFB7 |
| html-safe-nonce | c907f9d7d28a761e70ec2f6056c867dca0119760588ee4221d094448b90d17b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTlDOjI3RDNBRDo2NkQ1Mzk6ODQ1QUM1OjZCMDBERkI3IiwidmlzaXRvcl9pZCI6IjExMzY2NzA3NTAzMTMzNDA4NTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6f0d3dd98af197208a133794b993485c4110ca5dec046f9d329c9fb97b75b9df |
| hovercard-subject-tag | issue:4817973378 |
| 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/176/issue_layout |
| twitter:image | https://opengraph.githubassets.com/21dc95517a66a1a32caff14c18153dec4bd69abb117c0e130dc8472d04e3505b/purescript-lua/purescript-lua/issues/176 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/21dc95517a66a1a32caff14c18153dec4bd69abb117c0e130dc8472d04e3505b/purescript-lua/purescript-lua/issues/176 |
| og:image:alt | Problem Data/Unit.purs in the purescript-lua-prelude fork opens with -- @inline unit always, added on the assumption that unit is the cheapest possible thing to inline. The assumption is inverted: ... |
| 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 | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width