René's URL Explorer Experiment


Title: Undefined variable in compiled code · Issue #37 · purescript-lua/purescript-lua · GitHub

Open Graph Title: Undefined variable in compiled code · Issue #37 · purescript-lua/purescript-lua

X Title: Undefined variable in compiled code · Issue #37 · purescript-lua/purescript-lua

Description: A compilation in some cases may produce invalid lua that is fails at runtime. I have not figured out what exactly causes this behavior but succeeded to catch some example. Example I tried my best to minimize it but can't find a way to ma...

Open Graph Description: A compilation in some cases may produce invalid lua that is fails at runtime. I have not figured out what exactly causes this behavior but succeeded to catch some example. Example I tried my best t...

X Description: A compilation in some cases may produce invalid lua that is fails at runtime. I have not figured out what exactly causes this behavior but succeeded to catch some example. Example I tried my best t...

Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/37

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Undefined variable in compiled code","articleBody":"A compilation in some cases may produce invalid lua that is fails at runtime.\nI have not figured out what exactly causes this behavior but succeeded to catch some example.\n \n## Example\nI tried my best to minimize it but can't find a way to make it smaller.\n```purs\nmodule Example (baz) where\n\nimport Effect (Effect)\nimport Prelude (class Monad, Unit, bind, discard, pure, unit)\n\nbaz ∷ Effect Unit\nbaz = bar (pure unit)\n\nbar ∷ ∀ f. Monad f ⇒ f Unit → f Unit\nbar f = do\n  f\n  _ ← pure [ foo f ]\n  pure unit\n\nfoo ∷ ∀ f. Monad f ⇒ f Unit → f Unit\nfoo fn1 = do\n  _ ← fn1\n  fn1\n  fn1\n  fn1\n\n```\nRun via:\n```bash\npslua --foreign-path . --ps-output output--lua-output-file out.lua --entry Example\n```\n## Generated code\n```lua\n...\nreturn {\n  baz = (function()\n    return function(f)\n      local Bind1 = M.Effect_monadEffect.Bind1()\n      local pure = M.Control_Applicative_pure(M.Effect_monadEffect.Applicative0())\n      return M.Example_discard(Bind1)(f)(function()\n        return M.Control_Bind_bind(Bind1)(pure({\n          [1] = (function()\n            return function(fn1)\n              local discard1 = M.Example_discard(Bind11) -- Bind11 is not in scope\n              return M.Control_Bind_bind(M.Effect_monadEffect.Bind1())(fn1)(function(  )\n                return discard1(fn1)(function()\n                  return discard1(fn1)(function() return fn1 end)\n                end)\n              end)\n            end\n          end)()(f)\n        }))(function() return pure(M.Data_Unit_foreign.unit) end)\n      end)\n    end\n  end)()(M.Control_Applicative_pure(M.Effect_applicativeEffect)(M.Data_Unit_foreign.unit))\n}\n```\n\n## Version\npslua: [`684b8d2c32524394c51577636a258e71d00cfefb`](https://github.com/Unisay/purescript-lua/commit/684b8d2c32524394c51577636a258e71d00cfefb) (actual `master`)\n","author":{"url":"https://github.com/Renegatto","@type":"Person","name":"Renegatto"},"datePublished":"2025-10-09T19:51:00Z","url":"https://github.com/purescript-lua/purescript-lua/issues/37"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:032b6382-b0d0-06ca-8e68-0464a2d8e705
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC3A:1201C:7141F5:98B170:6B00D93A
html-safe-nonce017e46aca42ab0137f3d05c64d6c6f007b092b4a37a23a8b1a9b5dce2ca40eb2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzNBOjEyMDFDOjcxNDFGNTo5OEIxNzA6NkIwMEQ5M0EiLCJ2aXNpdG9yX2lkIjoiMjg4NDIyNjI5ODA0ODIwNzE2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac414b4b5b261ba0b30f1e08653e749218b31582f3ac8ddf8295aa77df2034835e
hovercard-subject-tagissue:3500435209
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-lua/purescript-lua/37/issue_layout
twitter:imagehttps://opengraph.githubassets.com/87d20597865080e095634f4e355aad6369ecc5554d45c033f2bffa8dd939f7ba/purescript-lua/purescript-lua/issues/37
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/87d20597865080e095634f4e355aad6369ecc5554d45c033f2bffa8dd939f7ba/purescript-lua/purescript-lua/issues/37
og:image:altA compilation in some cases may produce invalid lua that is fails at runtime. I have not figured out what exactly causes this behavior but succeeded to catch some example. Example I tried my best t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRenegatto
hostnamegithub.com
expected-hostnamegithub.com
Nonea481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b
turbo-cache-controlno-preview
go-importgithub.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git
octolytics-dimension-user_id131581790
octolytics-dimension-user_loginpurescript-lua
octolytics-dimension-repository_id587200487
octolytics-dimension-repository_nwopurescript-lua/purescript-lua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id587200487
octolytics-dimension-repository_network_root_nwopurescript-lua/purescript-lua
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84c8c5cc25e2fb7f2308428458538436baecc6d2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/issues/37#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F37
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F37
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/37
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/37
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/37
purescript-luahttps://github.com/purescript-lua
purescript-luahttps://github.com/purescript-lua/purescript-lua
Codehttps://github.com/purescript-lua/purescript-lua
Issues48 (48)https://github.com/purescript-lua/purescript-lua/issues
Pull requestshttps://github.com/purescript-lua/purescript-lua/pulls
Discussionshttps://github.com/purescript-lua/purescript-lua/discussions
Actionshttps://github.com/purescript-lua/purescript-lua/actions
Projectshttps://github.com/purescript-lua/purescript-lua/projects
Security and qualityhttps://github.com/purescript-lua/purescript-lua/security
Insightshttps://github.com/purescript-lua/purescript-lua/insights
https://github.com/purescript-lua/purescript-lua
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/37
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/37
#43https://github.com/purescript-lua/purescript-lua/pull/43
Undefined variable in compiled codehttps://github.com/purescript-lua/purescript-lua/issues/37#top
#43https://github.com/purescript-lua/purescript-lua/pull/43
https://github.com/Unisay
https://github.com/Renegatto
Renegattohttps://github.com/Renegatto
on Oct 9, 2025https://github.com/purescript-lua/purescript-lua/issues/37#issue-3500435209
684b8d2c32524394c51577636a258e71d00cfefbhttps://github.com/Unisay/purescript-lua/commit/684b8d2c32524394c51577636a258e71d00cfefb
Unisayhttps://github.com/Unisay
on Oct 13, 2025https://github.com/purescript-lua/purescript-lua/issues/37#event-20242320821
Unisayhttps://github.com/Unisay
on Oct 14, 2025https://github.com/purescript-lua/purescript-lua/issues/37#event-20274038041
test: add regression test for issue #37 undefined variable bughttps://github.com/purescript-lua/purescript-lua/commit/c3589a05f08f992f5867b0e8a9664720e190db24
#37https://github.com/purescript-lua/purescript-lua/issues/37
c3589a0https://github.com/purescript-lua/purescript-lua/commit/c3589a05f08f992f5867b0e8a9664720e190db24
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Oct 14, 2025https://github.com/purescript-lua/purescript-lua/issues/37#issuecomment-3402683931
this PRhttps://github.com/Unisay/purescript-lua/pull/38/files
https://github.com/Renegatto
Renegattohttps://github.com/Renegatto
on Oct 16, 2025https://github.com/purescript-lua/purescript-lua/issues/37#issuecomment-3410037636
@Unisayhttps://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jun 12, 2026https://github.com/purescript-lua/purescript-lua/issues/37#event-26671280521
test: reproduce issue #37 (undefined variable in compiled code)https://github.com/purescript-lua/purescript-lua/commit/47b3316bf3e82a5758485d7953b0b304dbd56623
#37https://github.com/purescript-lua/purescript-lua/issues/37
47b3316https://github.com/purescript-lua/purescript-lua/commit/47b3316bf3e82a5758485d7953b0b304dbd56623
test: pin sequential (let*) scoping convention for shift/substitute/c…https://github.com/purescript-lua/purescript-lua/commit/51d1b794dbcd71010c6829a86c163d83e394d112
51d1b79https://github.com/purescript-lua/purescript-lua/commit/51d1b794dbcd71010c6829a86c163d83e394d112
fix: align shift/substitute/countFreeRefs with sequential Let scoping (…https://github.com/purescript-lua/purescript-lua/commit/3c64f5ae4fed3a6d1629d0c6f8f46dd2ab6b5411
…https://github.com/purescript-lua/purescript-lua/issues/37
3c64f5ahttps://github.com/purescript-lua/purescript-lua/commit/3c64f5ae4fed3a6d1629d0c6f8f46dd2ab6b5411
docs: add Note [Sequential scoping of Let bindings]; fix same defect …https://github.com/purescript-lua/purescript-lua/commit/68e773eeab892d640ee44123dfb24751963cbf1a
68e773ehttps://github.com/purescript-lua/purescript-lua/commit/68e773eeab892d640ee44123dfb24751963cbf1a
docs: add Note [Sequential scoping of Let bindings]; fix same defect …https://github.com/purescript-lua/purescript-lua/commit/69bd23c11c074f28fa3ae78e439d3dc6716b1b36
69bd23chttps://github.com/purescript-lua/purescript-lua/commit/69bd23c11c074f28fa3ae78e439d3dc6716b1b36
Unisayhttps://github.com/Unisay
completedhttps://github.com/purescript-lua/purescript-lua/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#43https://github.com/purescript-lua/purescript-lua/pull/43
on Jun 12, 2026https://github.com/purescript-lua/purescript-lua/issues/37#event-26671778486
Unisayhttps://github.com/Unisay
on Jun 12, 2026https://github.com/purescript-lua/purescript-lua/issues/37#event-26671778500
Merge pull request #43 from Unisay/yura/fix-issue-37https://github.com/purescript-lua/purescript-lua/commit/34cc60e742b7225931a8d491c1e34d23e5e0ef40
#43https://github.com/purescript-lua/purescript-lua/pull/43
34cc60ehttps://github.com/purescript-lua/purescript-lua/commit/34cc60e742b7225931a8d491c1e34d23e5e0ef40
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jun 12, 2026https://github.com/purescript-lua/purescript-lua/issues/37#issuecomment-4690650924
#43https://github.com/purescript-lua/purescript-lua/pull/43
Sign up for freehttps://github.com/signup?return_to=https://github.com/purescript-lua/purescript-lua/issues/37
Sign in to commenthttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/37
Unisayhttps://github.com/Unisay
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.