haskell: Phase 8 — print x = putStrLn (show x) in prelude (replaces builtin)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -102,7 +102,7 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
|
||||
shows with escaped double-quotes). _Deferred:_ `"'a'"` Char single-quotes
|
||||
(needs Char tagging — currently Char = Int by representation, ambiguous in
|
||||
show); `\n`/`\t` escape inside Strings.
|
||||
- [ ] `show` Prelude binding calls `hk-show-val`; `print x = putStrLn (show x)`.
|
||||
- [x] `show` Prelude binding calls `hk-show-val`; `print x = putStrLn (show x)`.
|
||||
- [ ] `deriving Show` auto-generates proper show for record-style and
|
||||
multi-constructor ADTs. Nested application arguments wrapped in parens:
|
||||
if `show arg` contains a space, emit `"(" ++ show arg ++ ")"`.
|
||||
@@ -286,6 +286,14 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
|
||||
|
||||
_Newest first._
|
||||
|
||||
**2026-05-06** — Phase 8 `print` is `putStrLn (show x)` in prelude:
|
||||
- Added `print x = putStrLn (show x)` to `hk-prelude-src` and removed the
|
||||
standalone `print` builtin. `print` now resolves through the Haskell-level
|
||||
Prelude path; lazy reference resolution handles the forward call to
|
||||
`putStrLn` (registered after the prelude loads). `show` already calls
|
||||
`hk-show-val` from the Phase 8 audit. do-io / program-fib / program-fizzbuzz
|
||||
remain green.
|
||||
|
||||
**2026-05-06** — Phase 8 audit: `hk-show-val` matches Haskell 98 format:
|
||||
- `eval.sx`: introduced `hk-show-prec v p` with precedence-based parens.
|
||||
Top-level `show (Just 3)` = `"Just 3"` (no parens); nested `show (Just (Just 3))`
|
||||
|
||||
Reference in New Issue
Block a user