Skip to content

chore: finalize traverse fix — mapWithIndex, regression test, tooling alignment#4

Merged
Unisay merged 1 commit into
masterfrom
chore/finalize-traverse
Jun 14, 2026
Merged

chore: finalize traverse fix — mapWithIndex, regression test, tooling alignment#4
Unisay merged 1 commit into
masterfrom
chore/finalize-traverse

Conversation

@Unisay

@Unisay Unisay commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Builds on the merged traverse fix (#2 by @Renegatto) to fully close out the Array traverse / mapWithIndex bugs and bring the fork to the canonical tooling.

mapWithIndex (0-based). mapWithIndexArray passed the 1-based Lua loop index to f, but PureScript mapWithIndex is 0-based — so f saw i instead of i - 1. Fixed (originally reported in #1 by @sarahnya).

Regression suite. test-regression/ (run by scripts/test) covers: traverse over Maybe is length- and order-preserving at sizes 0–8 (sizes > 3 exercise the divide-and-conquer pivot branch — the one that appends sub-results, which only works with the Array Semigroup fix shipped in prelude v7.2.2), traverse over the Array applicative, and 0-based mapWithIndex. Verified green on Lua 5.1.

Tooling alignment. purescript-overlay dev shell pinned to Lua 5.1 (drops easy-purescript-nix and its EOL/insecure nodejs, so plain nix develop evaluates), canonical nix CI replacing the inherited bower workflow, fail-fast scripts/build/scripts/test, and the package set bumped to psc-0.15.15-20260614 (which carries prelude v7.2.2). Supersedes the earlier tooling-normalization PR #3.

Closes #1.

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
@Unisay Unisay merged commit 78a544d into master Jun 14, 2026
1 check passed
@Unisay Unisay deleted the chore/finalize-traverse branch June 14, 2026 12:18
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.

1 participant