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-numbers
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-numbers
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.
  • 20 commits
  • 28 files changed
  • 3 contributors

Commits on Mar 31, 2024

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

Commits on Jun 14, 2026

  1. fix: use bound argument n in Format.lua FFI instead of unbound number

    The native formatting functions in src/Data/Number/Format.lua passed an
    unbound variable `number` to string.format while the actual Number argument
    was bound as `n`. At runtime `number` resolved to a nil global, so
    toPrecisionNative/toFixedNative/toExponentialNative errored instead of
    formatting their input. Reference each function's real argument `n`.
    
    Closes purescript-lua#1
    Unisay committed Jun 14, 2026
    Configuration menu
    Copy the full SHA
    c63dec6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    61f141b View commit details
    Browse the repository at this point in the history
  3. Merge pull request #2 from Unisay/fix/numbers-format

    fix: use bound argument n in Format.lua FFI instead of unbound number
    Unisay authored Jun 14, 2026
    Configuration menu
    Copy the full SHA
    8226836 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    de270c9 View commit details
    Browse the repository at this point in the history
  5. 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
    3b07ea9 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #4 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
    213598c View commit details
    Browse the repository at this point in the history
  7. 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
    66c3222 View commit details
    Browse the repository at this point in the history
  8. Merge pull request #5 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
    7d5a65b View commit details
    Browse the repository at this point in the history
  9. 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
    b35757b View commit details
    Browse the repository at this point in the history
  10. Merge pull request #6 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
    4a2884d View commit details
    Browse the repository at this point in the history
  11. 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
    d7660d2 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2026

  1. Merge pull request #7 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
    e6a5a92 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
    5585574 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
    1d48c65 View commit details
    Browse the repository at this point in the history
  4. fix: toFixedNative uses %f, not %d (was truncating floats)

    string.format("%.<d>d", n) is integer formatting, so toFixed dropped the
    fractional part (e.g. toFixed 2 3.14159 -> garbage). Use %f for fixed-point
    decimals. Fixes purescript-lua#3.
    
    Verified under Lua 5.1 (3.14159->3.14, 3.7@0->4, 2.5@3->2.500, 10@2->10.00).
    Unisay committed Jun 15, 2026
    Configuration menu
    Copy the full SHA
    5eb47a2 View commit details
    Browse the repository at this point in the history
  5. fix: Data.Number / Data.Number.Format FFI match the JS contract

    Aligns the FFI with the modules' own docstrings (the JS Number semantics):
    
    - toPrecisionNative used %f (d digits after the point); JS toPrecision is
      d SIGNIFICANT digits, so it was wrong for every input and destroyed small
      magnitudes (precision 3 of 0.000123456 gave "0.000"). Now uses %g.
    - fromStringImpl wrapped tonumber's nil in Just on a parse failure (a
      Just Number holding nil) and ignored the supplied isFinite predicate. It
      now extracts a leading numeric prefix (matching parseFloat's tolerance of
      a whitespace prefix and trailing junk, e.g. "  1.2 ??" -> Just 1.2),
      guards the parse, and uses isFinite, so "bad"/"" -> Nothing.
    - sign encoded the result through the boolean condition, so sign 0 returned
      the boolean `true` instead of the Number 0. Now uses explicit branches.
    - max/min folded with Lua's >/< which drop NaN, so e.g. max 1 NaN gave 1;
      JS Math.max/min return NaN if either argument is NaN. Added a NaN guard.
    - toExponentialNative emitted C's zero-padded exponent (1.23e+03); JS uses
      the minimal exponent width (1.23e+3). Strips one leading exponent zero.
    - toString spelled the specials "inf"/"-inf"/"nan"; now "Infinity"/
      "-Infinity"/"NaN". (Finite values keep Lua's %.14g formatting — the JS
      shortest-round-trip form is out of scope; see #99 / accepted divergences.)
    
    Extends test/regression/format.lua and adds test/regression/number.lua.
    
    Fixes purescript-lua/purescript-lua#92
    Fixes purescript-lua/purescript-lua#93
    Fixes purescript-lua/purescript-lua#94
    Fixes purescript-lua/purescript-lua#95
    Fixes purescript-lua/purescript-lua#96
    Fixes purescript-lua/purescript-lua#97
    Fixes purescript-lua/purescript-lua#98
    Unisay committed Jun 15, 2026
    Configuration menu
    Copy the full SHA
    d27efeb View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2026

  1. feat: migrate to the new spago (spago.yaml + published package set)

    Build against the published purescript-lua package set via
    workspace.packageSet.url instead of the old spago.dhall + packages.dhall
    (upstream-ps // upstream-lua) merge. The new spago drives spago.yaml/spago.lock
    and dropped Dhall.
    
    - spago.dhall/packages.dhall -> spago.yaml (package name lua-numbers; the new
      spago rejects the purescript- prefix). backend.cmd "true" keeps codegen on
      corefn; scripts/build runs pslua over it as before (dropped the now-redundant
      `-u '-g corefn'` flag since the no-op backend already selects corefn).
    - flake.nix: spago 0.21.0 -> 1.x; drop the now-unused dhall dev-shell tool.
    - treefmt.nix: drop the dead Dhall formatter. AGENTS.md: spago 1.x, src/packages.json.
    - CI action versions bumped to current majors (checkout v5, install-nix v31).
    - Remove the upstream PureScript test source test/Test/Main.purs (never built:
      old sources globbed src/ only, and it carries JS FFI that doesn't target Lua).
      The Lua regression tests under test/regression stay.
    Unisay committed Jun 24, 2026
    Configuration menu
    Copy the full SHA
    4c6b5bc View commit details
    Browse the repository at this point in the history
  2. chore: remove vestigial treefmt.toml

    Dead config: nix fmt formats via treefmt.nix, and nothing reads treefmt.toml
    (the pre-commit hook and CI both run nix fmt).
    Unisay committed Jun 24, 2026
    Configuration menu
    Copy the full SHA
    f519226 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2026

  1. docs: add scriv-managed changelog, backfill fork releases

    Adds a CHANGELOG.md managed with scriv (fragments in changelog.d/), provides
    scriv in the flake dev shell, and records the fork's Lua 5.1 FFI release line.
    Where the upstream PureScript changelog existed it is preserved below the fork
    section. The AGENTS.md Releasing note now points at the scriv flow instead of
    "no changelog entry".
    
    Part of the ecosystem-wide changelog adoption
    (purescript-lua/purescript-lua#101); canon in package-set ADR 0009.
    Unisay committed Jun 25, 2026
    Configuration menu
    Copy the full SHA
    e70efce View commit details
    Browse the repository at this point in the history
Loading