Skip to content

Fix traverse failing at runtime#2

Merged
Unisay merged 2 commits into
purescript-lua:masterfrom
Renegatto:alexey/fix-append
Jun 14, 2026
Merged

Fix traverse failing at runtime#2
Unisay merged 2 commits into
purescript-lua:masterfrom
Renegatto:alexey/fix-append

Conversation

@Renegatto

Copy link
Copy Markdown

Description of the change

traverse is failing at runtime due to 2 reasons:

  • It is using table.concat for array concatenation, which does not do that.
  • It's Lua implementation is equivalent to its JS implementation, not considering Lua array indicies start from 1, not 0 as in JS.

This PR fixes both.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

Renegatto and others added 2 commits October 25, 2025 12:08
Traverse used JS implementation which is OK except that the array indexing was starting from 0.
@Unisay Unisay merged commit 15afbd7 into purescript-lua:master Jun 14, 2026
Unisay added a commit that referenced this pull request Jun 14, 2026
Follows the merged traverse fix (#2 by @Renegatto). On top of it:

- Fix mapWithIndexArray: it passed the 1-based Lua loop index to f, but
  PureScript mapWithIndex is 0-based, so f received i instead of i-1
  (originally reported in #1 by @sarahnya).
- Add a focused regression suite (test-regression/) run by scripts/test:
  traverse over Maybe is length/order-preserving at every size (>3 hits
  the pivot/append branch, which needs the Array Semigroup fix shipped in
  prelude v7.2.2), traverse over the Array applicative, and 0-based
  mapWithIndex.
- Align tooling: purescript-overlay dev shell on Lua 5.1 (drops easy-ps /
  insecure nodejs), canonical nix CI replacing the bower workflow,
  fail-fast scripts, and bump the package set to psc-0.15.15-20260614
  (prelude v7.2.2). Supersedes the earlier normalization PR #3.

Closes #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants