haskell: Phase 10 — fromIntegral verified as prelude identity (+4 tests, 14/14)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m6s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 06:44:45 +00:00
parent 25cf832998
commit 2d373da06b
2 changed files with 40 additions and 2 deletions

View File

@@ -148,9 +148,10 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
note limit in a comment if there is one. _Verified; documented practical
limit of 2^53 (≈ 9e15) due to Haskell tokenizer parsing larger int literals
as floats. Raw SX is exact to ±2^62. See header comment in `numerics.sx`._
- [ ] `fromIntegral :: (Integral a, Num b) => a -> b` — identity in our runtime
- [x] `fromIntegral :: (Integral a, Num b) => a -> b` — identity in our runtime
(all numbers share one SX type); register as a builtin no-op with the correct
typeclass signature.
typeclass signature. _Already in `hk-prelude-src` as `fromIntegral x = x`;
verified with new tests in `numerics.sx`._
- [ ] `toInteger`, `fromInteger` — same treatment.
- [ ] Float/Double literals round-trip through `hk-show-val`:
`show 3.14 = "3.14"`, `show 1.0e10 = "1.0e10"`.
@@ -295,6 +296,13 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
_Newest first._
**2026-05-07** — Phase 10 `fromIntegral` verified (already an identity in prelude):
- Pre-existing `fromIntegral x = x` line in `hk-prelude-src` was already
correct — all numbers share one SX type, so the identity implementation is
exactly what the plan asked for. Added 4 tests in `numerics.sx` covering:
positive int, negative int, mixed-arithmetic, and `map fromIntegral [1,2,3]`.
Suite is now 14/14.
**2026-05-07** — Phase 10 large-integer audit (numerics.sx 10/10):
- Investigated SX number behavior in Haskell context. Findings:
• Raw SX `*`, `+`, etc. on two ints stay exact up to ±2^62 (~4.6e18).