diff --git a/plans/haskell-on-sx.md b/plans/haskell-on-sx.md index a799ec6d..8ef83b43 100644 --- a/plans/haskell-on-sx.md +++ b/plans/haskell-on-sx.md @@ -85,7 +85,7 @@ Key mappings: - [x] `fib.hs` — infinite Fibonacci stream - [x] `sieve.hs` — lazy sieve of Eratosthenes - [x] `quicksort.hs` — naive QS - - [ ] `nqueens.hs` + - [x] `nqueens.hs` - [ ] `calculator.hs` — parser combinator style expression evaluator - [ ] `lib/haskell/conformance.sh` + runner; `scoreboard.json` + `scoreboard.md` - [ ] Target: 5/5 classic programs passing @@ -114,6 +114,16 @@ Key mappings: _Newest first._ +- **2026-04-25** — Classic program `nqueens.hs`: backtracking n-queens via list + comprehension and multi-clause `where`. Three fixes needed: (1) `hk-eval-let` + now delegates to `hk-bind-decls!` so multi-clause `where`/`let` bindings + (e.g., `go 0 = [[]]; go k = [...]`) are grouped as multifuns; (2) added + `concatMap`, `concat`, `abs`, `negate` to `hk-prelude-src` (list comprehensions + desugar to `concatMap`); (3) cached the Prelude env in `hk-env0` so + `hk-eval-expr-source` copies it instead of re-parsing. Tests: `queens 4 = 2`, + `queens 5 = 10`. n=8 (92 solutions) is too slow at ~50s/n — omitted. + 397/397 green. + - **2026-04-25** — Classic program `quicksort.hs`: naive functional quicksort. `qsort (x:xs) = qsort smaller ++ [x] ++ qsort larger where smaller = filter (< x) xs; larger = filter (>= x) xs`. No new runtime additions needed — right sections, `filter`, `++` all worked out of the box.