From fb51620a4cf89e8f263c468906bc3546fcb42ecc Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 6 May 2026 08:57:23 +0000 Subject: [PATCH] plans: tick dict-passing elaborator + progress log --- plans/haskell-on-sx.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plans/haskell-on-sx.md b/plans/haskell-on-sx.md index 3ec8b440..6d7212ad 100644 --- a/plans/haskell-on-sx.md +++ b/plans/haskell-on-sx.md @@ -100,7 +100,7 @@ Key mappings: ### Phase 5 — typeclasses (dictionary passing) - [x] `class` / `instance` declarations -- [ ] Dictionary-passing elaborator: inserts dict args at call sites +- [x] Dictionary-passing elaborator: inserts dict args at call sites - [ ] Standard classes: `Eq`, `Ord`, `Show`, `Num`, `Functor`, `Monad`, `Applicative` - [ ] `deriving (Eq, Show)` for ADTs @@ -114,6 +114,13 @@ Key mappings: _Newest first._ +- **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 + apply; thunk-forcing uses `hk-force` not `type-of == "thunk"` (Haskell thunks + are dicts, not SX native thunks). `tests/class.sx` gains 3 dispatch tests + (Int instance, Bool instance, error on unknown). 506/506 green. + - **2026-05-06** — Phase 5 class/instance declarations. Parser: `hk-parse-class` and `hk-parse-instance` added to the parser closure; `hk-parse-decl` gains arms for `"class"` and `"instance"` reserved words (tokenizer already marks