René's URL Explorer Experiment


Title: Implement Data.String.CodePoints, repair the test suite by Unisay · Pull Request #1 · purescript-lua/purescript-lua-strings · GitHub

Open Graph Title: Implement Data.String.CodePoints, repair the test suite by Unisay · Pull Request #1 · purescript-lua/purescript-lua-strings

X Title: Implement Data.String.CodePoints, repair the test suite by Unisay · Pull Request #1 · purescript-lua/purescript-lua-strings

Description: Implement Data.String.CodePoints, repair the test suite Closes purescript-lua/purescript-lua#36. CodePoints. The FFI file was a stub: 2 functions out of 7, both throwing Not implemented, with the wrong arity. In pslua a String is a Lua byte string holding UTF-8, so all seven foreign functions now decode/encode UTF-8 directly in plain Lua 5.1 arithmetic (no utf8 library, no bitops, string.char fed byte by byte). The PureScript fallback arguments are UTF-16 surrogate-pair logic and are deliberately ignored — under the byte representation they produce garbage. The pure uncons carried the same surrogate logic (charAt 0/1 yields bytes here, which are never in the surrogate range, so it silently returned the first byte as the head code point); its tail now starts after the UTF-8 width of the head. CodeUnits and Common were broken too. Once the suite ran, it showed CodeUnits returning 1-based Lua positions where 0-based indices are expected (charAt 0 was Nothing, indexOf off by one, lastIndexOf also ignored the pattern width), negative indices passed straight to string.sub (which counts from the end instead of clamping), and Common.replace/replaceAll/split treating Pattern as a Lua pattern — replaceAll (Pattern "[b]") ... replaced b. Index handling now mirrors the upstream JS, and matching is literal (string.find plain mode). Test suite. It had never run against this fork: scripts/test referenced a spago-test.dhall that did not exist, the package set pins predated prelude v7.2.0 and the assert override, and Test.Main imported Regex tests with no Data.String.Regex in src (dropped here, tracked separately). Each suite is also split into per-section functions: one hundred-statement do block compiles to Lua nested beyond the parser limit of stock Lua 5.1 (purescript-lua/purescript-lua#46). The CodePoints suite keeps the upstream structure but swaps the lone-surrogate test string (not representable in UTF-8) for well-formed Unicode of widths 1–4, and gains toCodePointArray/fromCodePointArray roundtrips. Two byte-semantics adaptations in NonEmpty.CodeUnits are commented inline. Merge order. The suite needs Unisay/purescript-lua PR with the Char-literal escaping fix (a '\n' Char literal otherwise produces an unloadable chunk) and the prelude fix/lua51-compat PR. packages.dhall temporarily overrides prelude with a local clone; swapping it back to a released package set is a follow-up commit once a set with prelude v7.2.1 is out. With all three in place, scripts/test is fully green.

Open Graph Description: Implement Data.String.CodePoints, repair the test suite Closes purescript-lua/purescript-lua#36. CodePoints. The FFI file was a stub: 2 functions out of 7, both throwing Not implemented, with the w...

X Description: Implement Data.String.CodePoints, repair the test suite Closes purescript-lua/purescript-lua#36. CodePoints. The FFI file was a stub: 2 functions out of 7, both throwing Not implemented, with the w...

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

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:724971f5-68ad-6e12-be10-89e7a5bd09f2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB39A:A99C2:CE758E:10A0FA1:6B00EF76
html-safe-noncef9380a40ec15419624b7c09f2c437339255980b54024dc2908968c4461176c3d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzlBOkE5OUMyOkNFNzU4RToxMEEwRkExOjZCMDBFRjc2IiwidmlzaXRvcl9pZCI6IjgwNTUwNDc1MDU3MTQ0MDkzMzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac25a9cce3a5440686ed19e555f01426f1751b23448beb72e30a44d280f8b58033
hovercard-subject-tagpull_request:3859277655
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-strings/pull/1/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:altImplement Data.String.CodePoints, repair the test suite Closes purescript-lua/purescript-lua#36. CodePoints. The FFI file was a stub: 2 functions out of 7, both throwing Not implemented, with the w...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/purescript-lua/purescript-lua-strings git https://github.com/purescript-lua/purescript-lua-strings.git
octolytics-dimension-user_id131581790
octolytics-dimension-user_loginpurescript-lua
octolytics-dimension-repository_id776766247
octolytics-dimension-repository_nwopurescript-lua/purescript-lua-strings
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id17881174
octolytics-dimension-repository_parent_nwopurescript/purescript-strings
octolytics-dimension-repository_network_root_id17881174
octolytics-dimension-repository_network_root_nwopurescript/purescript-strings
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua-strings%2Fpull%2F1%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-strings%2Fpull%2F1%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-strings
Reloadhttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files
Reloadhttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files
Reloadhttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files
purescript-luahttps://github.com/purescript-lua
purescript-lua-stringshttps://github.com/purescript-lua/purescript-lua-strings
Codehttps://github.com/purescript-lua/purescript-lua-strings
Pull requestshttps://github.com/purescript-lua/purescript-lua-strings/pulls
Actionshttps://github.com/purescript-lua/purescript-lua-strings/actions
Projectshttps://github.com/purescript-lua/purescript-lua-strings/projects
Security and qualityhttps://github.com/purescript-lua/purescript-lua-strings/security
Insightshttps://github.com/purescript-lua/purescript-lua-strings/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpurescript-lua%2Fpurescript-lua-strings%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-strings%2Fissues%2Fnew%2Fchoose
Unisayhttps://github.com/Unisay
masterhttps://github.com/purescript-lua/purescript-lua-strings/tree/master
issue/codepoints-ffihttps://github.com/purescript-lua/purescript-lua-strings/tree/issue/codepoints-ffi
Conversation 15 https://github.com/purescript-lua/purescript-lua-strings/pull/1
Commits 6 https://github.com/purescript-lua/purescript-lua-strings/pull/1/commits
Checks 0 https://github.com/purescript-lua/purescript-lua-strings/pull/1/checks
Files changed https://github.com/purescript-lua/purescript-lua-strings/pull/1/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files
Implement Data.String.CodePoints, repair the test suite https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#top
Show all changes 6 commits https://github.com/purescript-lua/purescript-lua-strings/pull/1/files
2edd0e6 chore: repair the test build Unisay Jun 12, 2026 https://github.com/purescript-lua/purescript-lua-strings/pull/1/commits/2edd0e650d1be92d9028886f514b12a3c6b8ffa6
12679df test: split each suite into per-section functions Unisay Jun 12, 2026 https://github.com/purescript-lua/purescript-lua-strings/pull/1/commits/12679df6bf4ff370b8938b9e990b330e880a0754
644ae9f feat: implement Data.String.CodePoints for UTF-8 strings Unisay Jun 12, 2026 https://github.com/purescript-lua/purescript-lua-strings/pull/1/commits/644ae9fa81917fa554f0492a81fd06fa19582646
f49e9dc fix: 0-based indices and literal patterns in CodeUnits and Common Unisay Jun 12, 2026 https://github.com/purescript-lua/purescript-lua-strings/pull/1/commits/f49e9dc1844dad5a3b288854335d9f6a1950d1b3
9cd49b8 fix: byte-accurate uncons tail; cover decode/encode edges Unisay Jun 13, 2026 https://github.com/purescript-lua/purescript-lua-strings/pull/1/commits/9cd49b8850eb23049648b7fe3f97c46bd96a1ed7
056b535 chore: build against the released set; nix CI; fix uncons binding cycle Unisay Jun 13, 2026 https://github.com/purescript-lua/purescript-lua-strings/pull/1/commits/056b535ae0b98a16bf4d48aed66c52156d149682
Clear filters https://github.com/purescript-lua/purescript-lua-strings/pull/1/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files
ci.yml https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
flake.lock https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-216b2b7bfde9416c79d133bacb031e95702a20bdedb548c0b055c837aa4f6a9c
flake.nix https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0
packages.dhall https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-55226d4660eac810b9bb1eb14ee833492d23552251a54099fb4eb44aa53e2013
test https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-d7ad7c7666dae3e86d4d3a850f7c4df6dcde86454e9995001ea017e44a3d35d5
spago-test.dhall https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-08d72761139f531b0ddde445bb4ecd2dcbbebc618714a970d0c0d8e8ff1399b1
CodePoints.lua https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-fd328eac642b029b76f92fdf881a45e119e0efead2937f8c4847419a2ab84eed
CodePoints.purs https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-6495f0338abc27a1c6bcdcd478944d9e12e4bb8bde26a94e45c5fc300d3934a9
CodeUnits.lua https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-6c301868c4512ddeed42c24568e4a3bbe75861f738a96ce278f7c862e98e38e2
Common.lua https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-d358b7a4adaa66a0a79b7864e5b9230a01fde493876f4f5b48d4644d9958a822
CodePoints.purs https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-053ff79c3367ef998a26ffe6fcdf5a3a17a59df476edae0e36c40fce7267a16f
CodeUnits.purs https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-6ba841c45778fbfd488d427a86d131e8ec7cbf464e565059c1fda9990355b4c2
NonEmpty.purs https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-c4b1a8823ee38a048c0d1f39e807613ba2bd1f733f781207e50837c31fe2074c
CodeUnits.purs https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-3b3dba8e42d25341782765373e697fa911a67266a4c5ab18185531c0eec8232c
Regex.purs https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-294e07cd61281ebea425e17a020b3cc148920b0a7d227bac817c6a72ea3dbe59
Main.purs https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-5aad571cb426f9406cfb0503a45f57bc8a0f9627e1c3e5a3ed24a0a4448d842e
.github/workflows/ci.ymlhttps://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
View file https://github.com/purescript-lua/purescript-lua-strings/blob/056b535ae0b98a16bf4d48aed66c52156d149682/.github/workflows/ci.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua-strings/pull/1/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua-strings/pull/1/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
Please reload this pagehttps://github.com/purescript-lua/purescript-lua-strings/pull/1/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.