haskell: Phase 10 — Fractional stub: recip + fromRational (+3 tests, 31/31)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m21s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 08:23:04 +00:00
parent ef33e9a43a
commit e27daee4a8
3 changed files with 21 additions and 1 deletions

View File

@@ -162,7 +162,9 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
tests like `show 42 = "42"` rely on this rendering. Documented in `numerics.sx`._
- [x] Math builtins: `sqrt`, `floor`, `ceiling`, `round`, `truncate` — call
the corresponding SX numeric primitives.
- [ ] `Fractional` typeclass stub: `(/)`, `recip`, `fromRational`.
- [x] `Fractional` typeclass stub: `(/)`, `recip`, `fromRational`. _(/)
already a binop; `recip x = 1 / x` and `fromRational x = x` registered as
builtins in the post-prelude block._
- [ ] `Floating` typeclass stub: `pi`, `exp`, `log`, `sin`, `cos`, `(**)`
(power operator, maps to SX exponentiation).
- [ ] Tests in `lib/haskell/tests/numeric.sx` (≥ 15 tests: fromIntegral
@@ -301,6 +303,10 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
_Newest first._
**2026-05-07** — Phase 10 Fractional stub (recip, fromRational):
- `(/)` already a binop. Added `recip` and `fromRational` as builtins
post-prelude. 3 new tests in `numerics.sx` (now 31/31).
**2026-05-07** — Phase 10 math builtins (sqrt/floor/ceiling/round/truncate):
- Inserted in the post-prelude `begin` block so they override the prelude's
identity stubs. `ceiling` is the only one needing a definition (SX doesn't