Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: purescript/purescript-integers
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: purescript-lua/purescript-lua-integers
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 15 commits
  • 25 files changed
  • 3 contributors

Commits on Mar 31, 2024

  1. Configuration menu
    Copy the full SHA
    eec408f View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2026

  1. fix: declare n local in Data.Int.toStringAs

    The loop variable `n` in `toStringAs` was assigned without `local`,
    leaking a global and tripping luacheck ("setting non-standard global
    variable n"). Adding `local` confines it to function scope and clears
    the cascade of related warnings. No behaviour change.
    
    Closes purescript-lua#1
    Unisay committed Jun 14, 2026
    Configuration menu
    Copy the full SHA
    898bcb1 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #2 from Unisay/fix/integers-global-n

    fix: declare `n` local in Data.Int.toStringAs
    Unisay authored Jun 14, 2026
    Configuration menu
    Copy the full SHA
    cb9d591 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    763fccd View commit details
    Browse the repository at this point in the history
  4. chore: harden CI per review (drop accept-flake-config, fail-fast scri…

    …pts/build, run test via bash)
    Unisay committed Jun 14, 2026
    Configuration menu
    Copy the full SHA
    ba64874 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #3 from Unisay/chore/align-overlay

    chore: normalize build tooling (purescript-overlay, nix CI, Lua 5.1)
    Unisay authored Jun 14, 2026
    Configuration menu
    Copy the full SHA
    1f7c61e View commit details
    Browse the repository at this point in the history
  6. chore: add AGENTS.md + CLAUDE.md, drop dead JavaScript-era files

    AGENTS.md is the single instruction file the coding agents read natively;
    CLAUDE.md is a one-line @AGENTS.md import so Claude Code shares it. Also
    removes dead bower.json/package.json/.eslintrc.json. CI is already on the
    shared canon; no src/ change.
    Unisay committed Jun 14, 2026
    Configuration menu
    Copy the full SHA
    3ec1995 View commit details
    Browse the repository at this point in the history
  7. Merge pull request #4 from Unisay/chore/agents-md-and-canon-ci

    chore: add AGENTS.md, drop dead JavaScript-era files
    Unisay authored Jun 14, 2026
    Configuration menu
    Copy the full SHA
    c75b6fb View commit details
    Browse the repository at this point in the history
  8. chore: point pslua + package-set links at purescript-lua org

    Repos moved from Unisay/* to the purescript-lua org. Update the pslua
    flake input and lockfile owner (same rev 94c13ce), the packages.dhall
    upstream-lua release URL, and the AGENTS.md links, so nothing relies on
    the old-owner redirect.
    Unisay committed Jun 14, 2026
    Configuration menu
    Copy the full SHA
    3f40eb7 View commit details
    Browse the repository at this point in the history
  9. Merge pull request #5 from purescript-lua/chore/migrate-org-links

    chore: point pslua + package-set links at purescript-lua org
    Unisay authored Jun 14, 2026
    Configuration menu
    Copy the full SHA
    13b3fe9 View commit details
    Browse the repository at this point in the history
  10. chore: add treefmt formatting (nix fmt) and format the tree

    Wire treefmt via treefmt-nix: nixfmt, dhall format, purs-tidy (.tidyrc.json)
    and LuaFormatter for the FFI (.lua-format, kept over StyLua because it
    preserves the parentheses pslua's parser needs). `nix fmt` formats; the dev
    shell installs a content-based pre-commit hook and CI runs
    `nix fmt && git diff --exit-code` (content-based, since the in-place
    formatters bump mtime and would trip treefmt --fail-on-change). Lua lines
    budget 130 cols, matching the raised `luacheck --max-line-length`. The bulk
    of the diff is the first format pass.
    Unisay committed Jun 14, 2026
    Configuration menu
    Copy the full SHA
    0ab0c2e View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2026

  1. Merge pull request #6 from purescript-lua/chore/treefmt

    chore: add treefmt formatting (nix fmt + pre-commit + CI check)
    Unisay authored Jun 15, 2026
    Configuration menu
    Copy the full SHA
    79741bb View commit details
    Browse the repository at this point in the history
  2. chore: harden pre-commit hook (tracked .githooks/ + core.hooksPath)

    Replace the dev-shell installer that wrote .git/hooks/pre-commit with a
    tracked .githooks/pre-commit wired via `git config core.hooksPath .githooks`.
    
    Fixes three issues with the old hook: it gated on `[ -d .git ]` (false in
    worktrees/submodules where .git is a file), it clobbered any existing
    .git/hooks/pre-commit on every `nix develop`, and `nix fmt … || exit 0`
    swallowed real formatter failures. The new hook skips only when `nix` is
    absent (CI is the authoritative gate) and otherwise blocks on a `nix fmt`
    failure or reformat.
    Unisay committed Jun 15, 2026
    Configuration menu
    Copy the full SHA
    d595057 View commit details
    Browse the repository at this point in the history
  3. chore: bump pslua dev input to 62e3653

    Toolchain consistency: pin the pslua dev flake input to the current
    compiler main across the ecosystem. flake.lock only; the package set
    consumes sources + FFI, not this dev input, so no re-tag is needed.
    Unisay committed Jun 15, 2026
    Configuration menu
    Copy the full SHA
    ea42484 View commit details
    Browse the repository at this point in the history
  4. fix: Data.Int / Data.Int.Bits FFI match JS 32-bit Int semantics

    PureScript Int is 32-bit two's complement; the Lua FFI diverged from the
    JS semantics the package's own test suite encodes:
    
    - fromNumber returned Just for any Number (truncating the fraction); now
      Just only for an integral value inside the Int32 range, else Nothing.
    - fromStringAs accepted fractional and out-of-range strings and, for
      non-decimal bases, Lua's `tonumber` turned a leading '-' into a huge
      unsigned value. It now parses the sign itself, validates every digit
      against the base (rejecting floats/whitespace/illegal chars) and range-
      checks the result, so e.g. `fromStringAs hexadecimal "-ef" == Just (-239)`.
    - toStringAs emitted uppercase digits; JS toString(radix) is lowercase
      (`toStringAs hexadecimal 255 == "ff"`).
    - rem used Lua's floored `%` (sign of the divisor); now the truncated
      remainder with the sign of the dividend, consistent with `quot`.
    - pow returned a float and never wrapped; now `Math.pow(x,y) | 0`
      (truncate toward zero, wrap to Int32), so `pow 2 (-1) == 0`.
    - and/or/xor only looped while operands were positive, giving wrong
      results for negatives; they now operate on the unsigned 32-bit
      representation over a fixed 32 bits (`and (-1) 5 == 5`, `xor (-1) 0 == -1`).
    - shl/shr/zshr used `math.pow`/division with no masking or wrapping; they
      now implement JS 32-bit shifts (count mod 32; shl/shr re-signed, zshr
      zero-fill), so `shl 1 31 == -2147483648` and `zshr (-8) 1 == 2147483644`.
    
    Shared 32-bit helpers live in each file's foreign header. Adds a Lua 5.1
    regression guard (test/regression/int.lua) and a scripts/test runner.
    
    Fixes purescript-lua/purescript-lua#85
    Fixes purescript-lua/purescript-lua#86
    Fixes purescript-lua/purescript-lua#87
    Fixes purescript-lua/purescript-lua#88
    Fixes purescript-lua/purescript-lua#89
    Fixes purescript-lua/purescript-lua#90
    Fixes purescript-lua/purescript-lua#91
    Unisay committed Jun 15, 2026
    Configuration menu
    Copy the full SHA
    be0f106 View commit details
    Browse the repository at this point in the history
Loading