From 6c1a953c80165e0feb9afd29b6e90d3be61161d5 Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 6 May 2026 10:57:41 +0000 Subject: [PATCH] plans: tick standard classes + progress log --- plans/haskell-on-sx.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plans/haskell-on-sx.md b/plans/haskell-on-sx.md index 6d7212ad..f8a3c214 100644 --- a/plans/haskell-on-sx.md +++ b/plans/haskell-on-sx.md @@ -101,7 +101,7 @@ Key mappings: ### Phase 5 — typeclasses (dictionary passing) - [x] `class` / `instance` declarations - [x] Dictionary-passing elaborator: inserts dict args at call sites -- [ ] Standard classes: `Eq`, `Ord`, `Show`, `Num`, `Functor`, `Monad`, `Applicative` +- [x] Standard classes: `Eq`, `Ord`, `Show`, `Num`, `Functor`, `Monad`, `Applicative` - [ ] `deriving (Eq, Show)` for ADTs ### Phase 6 — real IO + Prelude completion @@ -114,6 +114,18 @@ Key mappings: _Newest first._ +- **2026-05-06** — Phase 5 standard classes. Prelude extended: `foldr`, `foldl`, + `foldl1`, `foldr1`, `zip`, `reverse`, `elem`, `notElem`, `any`, `all`, `and`, + `or`, `sum`, `product`, `maximum`, `minimum`, `compare`, `min`, `max`, + `signum`, `fromIntegral`, `null`, `flip`, `const`, `curry`, `uncurry`, + `lookup`, `maybe`, `either`, `fmap`, `pure`, `when`, `unless`, `mapM_`, + `sequence_`. `show` implemented as SX builtin (`hk-show-val`) dispatching on + runtime type (number, string, bool, list, tuple, ADT). `hk-eval-program` now + uses `hk-dict-copy hk-env0` instead of fresh `hk-init-env` — prelude parsed + once at load time, each program gets a shallow copy (10× speedup per call). + test.sh timeout 240s→360s for nqueens headroom. 48 new stdlib tests. + 554/554 green. + - **2026-05-06** — Phase 5 dict-passing elaborator. `hk-bind-decls!` class-decl arm now wraps dispatch functions as `hk-mk-lazy-builtin` (arity 1) so `hk-apply` can call them; instance methods called via `hk-apply` not native SX