Title: runEffectFn10 drops its tenth argument (j) · Issue #1 · purescript-lua/purescript-lua-effect · GitHub
Open Graph Title: runEffectFn10 drops its tenth argument (j) · Issue #1 · purescript-lua/purescript-lua-effect
X Title: runEffectFn10 drops its tenth argument (j) · Issue #1 · purescript-lua/purescript-lua-effect
Description: PureScript Lua: The Effect monad, for handling native side effects - runEffectFn10 drops its tenth argument (j) · Issue #1 · purescript-lua/purescript-lua-effect
Open Graph Description: PureScript Lua: The Effect monad, for handling native side effects - runEffectFn10 drops its tenth argument (j) · Issue #1 · purescript-lua/purescript-lua-effect
X Description: PureScript Lua: The Effect monad, for handling native side effects - runEffectFn10 drops its tenth argument (j) · Issue #1 · purescript-lua/purescript-lua-effect
Opengraph URL: https://github.com/purescript-lua/purescript-lua-effect
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"runEffectFn10 drops its tenth argument (j)","articleBody":"## Summary\n\n`runEffectFn10` in `src/Effect/Uncurried.lua` drops its tenth argument: it binds ten curried parameters `a` through `j` but only forwards nine of them to the underlying uncurried function, calling `fn(a, b, c, d, e, f, g, h, i)` instead of `fn(a, b, c, d, e, f, g, h, i, j)`.\n\n## Offending code\n\n```lua\nrunEffectFn10 = (function(fn)\n return function(a)\n return function(b)\n ...\n return function(j)\n return function()\n return fn(a, b, c, d, e, f, g, h, i) -- j is silently dropped\n end\n end\n ...\n```\n\n## Root cause\n\nA copy/paste arity error when the curried-application body was written. Every other member of the family is correct: `runEffectFn1` through `runEffectFn9` each forward exactly their N arguments, and all of `mkEffectFn1` through `mkEffectFn10` forward the full curried chain. Only `runEffectFn10`'s final call is short by one argument.\n\n## Impact\n\nAny PureScript code that imports a foreign function via `EffectFn10` and invokes it through `runEffectFn10` will execute the underlying function with its tenth argument bound to `nil`. The call still type-checks on the PureScript side and produces no runtime error, so the failure is silent: the tenth parameter is simply lost. In Lua this is especially easy to miss because a missing trailing argument is not an error, it just becomes `nil`.\n\n## How it was found\n\nRunning `luacheck --quiet --std min src/` flags the dropped binding as a dead parameter:\n\n```\nsrc/Effect/Uncurried.lua:197:39: unused argument j\n```\n\nThe `j` parameter is declared but never read precisely because the call site omits it.\n\n## Audit of the rest of the family\n\nI audited the whole `mkEffectFnN` / `runEffectFnN` family in this file. `runEffectFn10` is the only offender. There are no `Data.Function.Uncurried`-style helpers (`mkFnN` / `runFnN`) in this repository.\n\n## Fix\n\nForward `j` in the final call:\n\n```lua\nreturn fn(a, b, c, d, e, f, g, h, i, j)\n```\n\nThis is a one-token change confined to `src/`. After it, `luacheck` no longer reports the unused-argument warning for `src/Effect/Uncurried.lua`.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-06-14T08:32:23Z","url":"https://github.com/purescript-lua/purescript-lua-effect/issues/1"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:ccf99666-d30c-66d0-5e60-b01993e83bd6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9678:76F02:81758C:A8DB01:6B00DB73 |
| html-safe-nonce | 4b5b50767572c9a111ca130d410bd8b1edf3984dbd925e0d7faa2f3f76be35a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Njc4Ojc2RjAyOjgxNzU4QzpBOERCMDE6NkIwMERCNzMiLCJ2aXNpdG9yX2lkIjoiNjk0MDA5MTcyOTU5Mjc2OTM5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c4701ed1cebbd10a5459531df2e7e8fd2935ea34cb52e3aa70106d5dfc5f9b7d |
| hovercard-subject-tag | repository:620968041 |
| 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/purescript-lua/purescript-lua-effect/issues/1 |
| twitter:image | https://opengraph.githubassets.com/c629f89fff866ce5f8b122d9dde88ff309ed41a8043258b7ffd45da4108a7d1c/purescript-lua/purescript-lua-effect |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c629f89fff866ce5f8b122d9dde88ff309ed41a8043258b7ffd45da4108a7d1c/purescript-lua/purescript-lua-effect |
| og:image:alt | PureScript Lua: The Effect monad, for handling native side effects - runEffectFn10 drops its tenth argument (j) · Issue #1 · purescript-lua/purescript-lua-effect |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-cache |
| go-import | github.com/purescript-lua/purescript-lua-effect git https://github.com/purescript-lua/purescript-lua-effect.git |
| octolytics-dimension-user_id | 131581790 |
| octolytics-dimension-user_login | purescript-lua |
| octolytics-dimension-repository_id | 620968041 |
| octolytics-dimension-repository_nwo | purescript-lua/purescript-lua-effect |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 119270415 |
| octolytics-dimension-repository_parent_nwo | purescript/purescript-effect |
| octolytics-dimension-repository_network_root_id | 119270415 |
| octolytics-dimension-repository_network_root_nwo | purescript/purescript-effect |
| 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