René's URL Explorer Experiment


Title: Avoid IIFE wrapping in IR.Abs lowering by Unisay · Pull Request #170 · purescript-lua/purescript-lua · GitHub

Open Graph Title: Avoid IIFE wrapping in IR.Abs lowering by Unisay · Pull Request #170 · purescript-lua/purescript-lua

X Title: Avoid IIFE wrapping in IR.Abs lowering by Unisay · Pull Request #170 · purescript-lua/purescript-lua

Description: IR.Abs lowering was routing every body through asExpression, so a Let or IfThenElse body became (function() chunk end)() inside a return. removeScopeWhenInsideEmptyFunction then had to undo that on every such lambda. Changes: lib/Language/PureScript/Backend/Lua.hs — IR.Abs now uses the chunk-aware go path. When the body lowers to Left chunk, it emits Lua.functionDef luaParams chunk directly; only Right expr falls back to [Lua.return e]. lib/Language/PureScript/Backend/Lua/Optimizer.hs — removed the now-dead removeScopeWhenInsideEmptyFunction rule and its Return import. test/Language/PureScript/Backend/Lua/Optimizer/Spec.hs — removed the test for the deleted rule. Before: function(x) return (function() local y = f(x) return y end)() end After: function(x) local y = f(x) return y end Summary Checklist Added a changelog.d/ fragment for any user-facing change (scriv create in the dev shell), or this change ships nothing releasable (CI, docs, or an internal refactor). In the dev shell (nix develop), fourmolu -i lib/ exe/ test/ and hlint lib/ exe/ test/ are clean. In the dev shell, cabal test all passes; structural goldens were re-accepted on purpose if codegen moved (PSLUA_GOLDEN_ACCEPT=1), and eval/golden.txt still holds. Fixes #158. Supersedes #160: same commits, reopened as a maintainer-authored PR so the required workflow runs are created (runs on PRs authored by the Copilot agent require manual approval and were never created for the follow-up pushes).

Open Graph Description: IR.Abs lowering was routing every body through asExpression, so a Let or IfThenElse body became (function() chunk end)() inside a return. removeScopeWhenInsideEmptyFunction then had to undo that on...

X Description: IR.Abs lowering was routing every body through asExpression, so a Let or IfThenElse body became (function() chunk end)() inside a return. removeScopeWhenInsideEmptyFunction then had to undo that on...

Opengraph URL: https://github.com/purescript-lua/purescript-lua/pull/170

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:33552608-3338-2597-6f0e-a9f9679712dd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDC88:21BD98:15CECF:1B7E40:6B00F9C7
html-safe-nonce7998dfc9e29c3a47f94f2d48c9b7412ac52dc337c7be6d7b41174f87560afadd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzg4OjIxQkQ5ODoxNUNFQ0Y6MUI3RTQwOjZCMDBGOUM3IiwidmlzaXRvcl9pZCI6Ijg3NzE2NzUyNTQ0NTcxNzAzNzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1467de0bebf539e17a3e111fe8218894e84f4b5f857921af40bb70a94d115ab0
hovercard-subject-tagpull_request:3996627058
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/purescript-lua/purescript-lua/pull/170/files
twitter:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
og:image:altIR.Abs lowering was routing every body through asExpression, so a Let or IfThenElse body became (function() chunk end)() inside a return. removeScopeWhenInsideEmptyFunction then had to undo that on...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7dafd017fb7809a839c443dba08622af38e63c09
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/pull/170/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fpull%2F170%2Ffiles
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%2Fpull%2F170%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/170/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/170/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/170/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
Unisayhttps://github.com/Unisay
mainhttps://github.com/purescript-lua/purescript-lua/tree/main
issue-158/abs-chunk-loweringhttps://github.com/purescript-lua/purescript-lua/tree/issue-158/abs-chunk-lowering
Conversation 1 https://github.com/purescript-lua/purescript-lua/pull/170
Commits 5 https://github.com/purescript-lua/purescript-lua/pull/170/commits
Checks 4 https://github.com/purescript-lua/purescript-lua/pull/170/checks
Files changed https://github.com/purescript-lua/purescript-lua/pull/170/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/170/files
Avoid IIFE wrapping in IR.Abs lowering https://github.com/purescript-lua/purescript-lua/pull/170/files#top
Show all changes 5 commits https://github.com/purescript-lua/purescript-lua/pull/170/files
57da937 Initial plan Copilot Jul 4, 2026 https://github.com/purescript-lua/purescript-lua/pull/170/commits/57da937b668e3c5551994888aeb745ea820d948c
dc73d11 Avoid IIFE wrapping in IR.Abs lowering and remove dead optimizer rule Copilot Jul 4, 2026 https://github.com/purescript-lua/purescript-lua/pull/170/commits/dc73d112edf0ee2fab8adb46df008667850ffa09
e711449 Add IR.Abs chunk-body regression tests Copilot Jul 5, 2026 https://github.com/purescript-lua/purescript-lua/pull/170/commits/e7114491c273dd225ef3ade90761d6a3f13d2be8
34e9c82 Merge remote-tracking branch 'origin/main' into pr160-work Unisay Jul 6, 2026 https://github.com/purescript-lua/purescript-lua/pull/170/commits/34e9c82522ce7cd57762e16d601042b5f365f7a7
385e405 test: fix compilation of the Abs regression spec (error row, imports) Unisay Jul 6, 2026 https://github.com/purescript-lua/purescript-lua/pull/170/commits/385e40556f34def85c9ca36cf2d9ae9f330a119b
Clear filters https://github.com/purescript-lua/purescript-lua/pull/170/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/170/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/170/files
Lua.hs https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
Optimizer.hs https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-729235f45985a9f15089eee44d4ee219effa1f8365a3359452ff51c908fe5e41
pslua.cabal https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-cf0302393cf6443df4429c19c0fc326753a83405d0366075a98ac2753e5e1ab2
Spec.hs https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-0cf3bacadac71b36286d45fe27adeb3db6839bc38502708722e8552067effd2a
Spec.hs https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-77712c610ee12122e63661289b0f15ab3392c5fc044dbbbf84b63e1436240266
Main.hs https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-9e8bdd24d557cfe94781d844e68e97f4b626c833420d18df4e04619a54273b34
lib/Language/PureScript/Backend/Lua.hshttps://github.com/purescript-lua/purescript-lua/pull/170/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
View file https://github.com/purescript-lua/purescript-lua/blob/385e40556f34def85c9ca36cf2d9ae9f330a119b/lib/Language/PureScript/Backend/Lua.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/170/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
lib/Language/PureScript/Backend/Lua/Optimizer.hshttps://github.com/purescript-lua/purescript-lua/pull/170/files#diff-729235f45985a9f15089eee44d4ee219effa1f8365a3359452ff51c908fe5e41
View file https://github.com/purescript-lua/purescript-lua/blob/385e40556f34def85c9ca36cf2d9ae9f330a119b/lib/Language/PureScript/Backend/Lua/Optimizer.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/170/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-729235f45985a9f15089eee44d4ee219effa1f8365a3359452ff51c908fe5e41
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-729235f45985a9f15089eee44d4ee219effa1f8365a3359452ff51c908fe5e41
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-729235f45985a9f15089eee44d4ee219effa1f8365a3359452ff51c908fe5e41
pslua.cabalhttps://github.com/purescript-lua/purescript-lua/pull/170/files#diff-cf0302393cf6443df4429c19c0fc326753a83405d0366075a98ac2753e5e1ab2
View file https://github.com/purescript-lua/purescript-lua/blob/385e40556f34def85c9ca36cf2d9ae9f330a119b/pslua.cabal
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/170/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-cf0302393cf6443df4429c19c0fc326753a83405d0366075a98ac2753e5e1ab2
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-cf0302393cf6443df4429c19c0fc326753a83405d0366075a98ac2753e5e1ab2
test/Language/PureScript/Backend/Lua/Optimizer/Spec.hshttps://github.com/purescript-lua/purescript-lua/pull/170/files#diff-0cf3bacadac71b36286d45fe27adeb3db6839bc38502708722e8552067effd2a
View file https://github.com/purescript-lua/purescript-lua/blob/385e40556f34def85c9ca36cf2d9ae9f330a119b/test/Language/PureScript/Backend/Lua/Optimizer/Spec.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/170/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-0cf3bacadac71b36286d45fe27adeb3db6839bc38502708722e8552067effd2a
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-0cf3bacadac71b36286d45fe27adeb3db6839bc38502708722e8552067effd2a
test/Language/PureScript/Backend/Lua/Spec.hshttps://github.com/purescript-lua/purescript-lua/pull/170/files#diff-77712c610ee12122e63661289b0f15ab3392c5fc044dbbbf84b63e1436240266
View file https://github.com/purescript-lua/purescript-lua/blob/385e40556f34def85c9ca36cf2d9ae9f330a119b/test/Language/PureScript/Backend/Lua/Spec.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/170/{{ revealButtonHref }}
test/Main.hshttps://github.com/purescript-lua/purescript-lua/pull/170/files#diff-9e8bdd24d557cfe94781d844e68e97f4b626c833420d18df4e04619a54273b34
View file https://github.com/purescript-lua/purescript-lua/blob/385e40556f34def85c9ca36cf2d9ae9f330a119b/test/Main.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/170/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-9e8bdd24d557cfe94781d844e68e97f4b626c833420d18df4e04619a54273b34
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-9e8bdd24d557cfe94781d844e68e97f4b626c833420d18df4e04619a54273b34
https://github.com/purescript-lua/purescript-lua/pull/170/files#diff-9e8bdd24d557cfe94781d844e68e97f4b626c833420d18df4e04619a54273b34
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/170/files
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.