haskell: Phase 10 — Floating stub: pi, exp, log, sin, cos, ** (+6 tests, 37/37)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

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

View File

@@ -165,7 +165,7 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
- [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`, `(**)`
- [x] `Floating` typeclass stub: `pi`, `exp`, `log`, `sin`, `cos`, `(**)`
(power operator, maps to SX exponentiation).
- [ ] Tests in `lib/haskell/tests/numeric.sx` (≥ 15 tests: fromIntegral
identity, sqrt/floor/ceiling/round on known values, Float literal show,
@@ -303,6 +303,12 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
_Newest first._
**2026-05-07** — Phase 10 Floating stub (pi, exp, log, sin, cos, **):
- pi as a number constant; exp/log/sin/cos as builtins thunking through to SX
primitives. `(**)` added as a binop case in `hk-binop` mapping to SX `pow`.
6 new tests in `numerics.sx` (now 37/37). `2 ** 10 = 1024`, `log (exp 5) = 5`,
`sin 0 = 0`, `cos 0 = 1`, `pi ≈ 3.14159`, `exp 0 = 1`.
**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).