plans: tick nqueens.hs, progress log 2026-04-25
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user