From d33c52031889b8d161846a5de79af0df708bf783 Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 25 Apr 2026 18:00:02 +0000 Subject: [PATCH] plans: tick sieve.hs, progress log 2026-04-25 --- plans/haskell-on-sx.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plans/haskell-on-sx.md b/plans/haskell-on-sx.md index 6f92faf4..d59a2407 100644 --- a/plans/haskell-on-sx.md +++ b/plans/haskell-on-sx.md @@ -83,7 +83,7 @@ Key mappings: - [x] Do-notation for a stub `IO` monad (just threading, no real side effects yet) - [ ] Classic programs in `lib/haskell/tests/programs/`: - [x] `fib.hs` — infinite Fibonacci stream - - [ ] `sieve.hs` — lazy sieve of Eratosthenes + - [x] `sieve.hs` — lazy sieve of Eratosthenes - [ ] `quicksort.hs` — naive QS - [ ] `nqueens.hs` - [ ] `calculator.hs` — parser combinator style expression evaluator @@ -114,6 +114,14 @@ Key mappings: _Newest first._ +- **2026-04-25** — Classic program `sieve.hs`: lazy sieve of Eratosthenes. + Added `mod`, `div`, `rem`, `quot` to `hk-binop` (and as first-class + values in `hk-init-env`), enabling backtick operator use. The filter-based + sieve `sieve (p:xs) = p : sieve (filter (\x -> x \`mod\` p /= 0) xs)` works + with the existing lazy cons + Prelude `filter`. 2 new tests in + `lib/haskell/tests/program-sieve.sx` (first 10 primes, 20th prime = 71). + 390/390 green. + - **2026-04-25** — First classic program: `fib.hs`. Canonical Haskell source lives at `lib/haskell/tests/programs/fib.hs` (the two-cons-cell self-referential fibs definition plus a hand-rolled