Commit Graph

284 Commits

Author SHA1 Message Date
31308602ca haskell: Phase 9 — error builtin raises with hk-error: prefix (+2 tests, 57/57)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 58s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 02:24:45 +00:00
788e8682f5 haskell: Phase 8 conformance — showadt.hs + showio.hs (both 5/5)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m0s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:35:38 +00:00
bb134b88e3 haskell: Phase 8 — tests/show.sx expanded to 26/26 (full audit coverage)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 57s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:04:52 +00:00
d8dec07df3 haskell: Phase 8 — Read class stub (reads/readsPrec/read) (+3 tests, 10/10)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 53s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:32:38 +00:00
39c7baa44c haskell: Phase 8 — showsPrec/showParen/shows/showString stubs (+7 tests, 7/7)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:02:55 +00:00
ee74a396c5 haskell: Phase 8 deriving Show — verify nested-paren behavior (+4 tests, 15/15)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 23:28:19 +00:00
a8997ab452 haskell: Phase 8 — print x = putStrLn (show x) in prelude (replaces builtin)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 22:59:44 +00:00
80d6507e57 haskell: Phase 8 audit — hk-show-val matches Haskell 98 (precedence-based parens, no-space separators)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 22:27:30 +00:00
685fcd11d5 haskell: Phase 7 conformance — runlength-str.hs + ++ thunk-tail fix (+9 tests, 9/9)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 21:45:23 +00:00
f6efba410a haskell: Phase 7 conformance — caesar.hs (+8 tests, 8/8)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 53s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:54:53 +00:00
4a35998469 haskell: Phase 7 string=[Char] — O(1) string-view head/tail + chr/ord/toUpper/toLower/++ (+35 tests, 810/810)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 49s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:44:19 +00:00
09d65d2d7b haskell: 13 new program suites + scoreboard 156/156 (775 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
collatz, palindrome, maybe, fizzbuzz, anagram, roman, binary, either,
primes, zipwith, matrix, wordcount, powers — all 18/18 programs green.
conformance.sh PROGRAMS array updated; scoreboard.md regenerated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 17:02:02 +00:00
6bfb7b19f4 haskell: Phase 6 prelude extras (635/635)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
- hk-list-append: string ++ string via str (fixes unwords/unlines/intercalate)
- --sx-to-hk-- in words/lines builtins: use ":"/"[]" not "Cons"/"Nil"
- lines builtin: empty-string case returns ("[]") not ("Nil")
- New test file prelude-extra.sx: 47 tests covering ord, isAlpha/isDigit/
  isSpace/isUpper/isLower/isAlphaNum, digitToInt, words, lines, unwords,
  unlines, sort, nub, splitAt, span, break, partition, intercalate,
  intersperse, isPrefixOf, isSuffixOf, isInfixOf

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 15:51:12 +00:00
041cb9f3ef haskell: getLine/getContents/readFile/writeFile + 0-arity builtin force (+12 tests, 587/587)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 21s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 13:43:13 +00:00
578e54f06d haskell: real IO monad — putStrLn/print/putStr + hk-run-io (+10 tests, 575/575)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 20s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 13:10:42 +00:00
1c45262577 haskell: deriving (Eq, Show) for ADTs (+11 tests, 565/565)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 34s
Parser parses optional deriving clause; only appended to AST when non-empty.
hk-bind-decls! data arm generates dictShow_Con / dictEq_Con per constructor.
hk-binop == and /= now deep-force both sides (SX dict equality is by
reference — two thunks wrapping the same value compared as not-equal without
this). Three token-type fixes in the deriving parser (lparen/rparen/comma,
not "special").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 12:25:51 +00:00
d3e71ba356 haskell: standard classes — show, Ord, Num, Functor, Monad prelude (+48 tests, 554/554)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-05-06 10:57:20 +00:00
60a8eb24e0 haskell: dict-passing elaborator — runtime dispatch via hk-mk-lazy-builtin (+3 tests, 506/506)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
2026-05-06 08:56:39 +00:00
41a69ecca7 haskell: class/instance declarations — parse + instance dict eval (+11 tests, 503/503)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 53s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 00:22:44 +00:00
5c00b5c58b haskell: inference unit tests — 55+ expressions, Phase 4 complete (+16 tests, 492/492)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 23:47:57 +00:00
622c0851ce haskell: let-polymorphism tests — id/const/nested/twice at multiple types (+6 tests, 476/476)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 47s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 23:26:01 +00:00
d8f3f8c3b2 haskell: type-sig checking — hk-ast-type + hk-check-sig + sig-aware infer-prog (+6 tests, 470/470)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 23:02:34 +00:00
2606b83920 haskell: reject untypeable programs — hk-typecheck + hk-run-typed (+9 tests, 464/464)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 22:32:18 +00:00
68124adc3b haskell: type error reporting — hk-expr->brief + hk-infer-decl/prog (+21 tests, 455/455)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 48s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 21:40:16 +00:00
8f3b0d9301 haskell: Algorithm W type inference + 32 tests (434/434)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
Full HM inference in lib/haskell/infer.sx: unification, substitution,
occurs check, instantiation, generalisation, let-polymorphism.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 20:26:44 +00:00
9f71706bc8 haskell: conformance.sh runner + scoreboard.json + scoreboard.md (16/16, 5/5)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:26:26 +00:00
ba63cdf8c4 haskell: classic program calculator.hs + nested constructor patterns (+5 tests, 402/402)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 18:57:44 +00:00
8a9168c8d5 haskell: n-queens via list comprehension + where (+2 tests, 397/397)
- fix hk-eval-let: multi-clause where/let now uses hk-bind-decls!
  grouping (enables go 0 / go k pattern)
- add concatMap/concat/abs/negate to Prelude (list comprehension support)
- cache init env in hk-env0 (eval-expr-source 5x faster)
2026-04-25 18:40:27 +00:00
a12dcef327 haskell: naive quicksort classic program (+5 tests, 395/395) 2026-04-25 18:06:41 +00:00
9be65d7d60 haskell: lazy sieve of Eratosthenes (+mod/div/rem/quot, +2 tests, 390/390) 2026-04-25 17:59:39 +00:00
4ed7ffe9dd haskell: classic program fib.hs + source-order top-level binding (+2 tests, 388/388)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 08:53:47 +00:00
cd489b19be haskell: do-notation desugar + stub IO monad (return/>>=/>>) (+14 tests, 382/382)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 00:59:42 +00:00
04a25d17d0 haskell: seq + deepseq via lazy-builtin flag (+9 tests, 368/368)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 00:28:19 +00:00
cc5315a5e6 haskell: lazy : + ranges + Prelude (repeat/iterate/fibs/take, +25 tests, 359/359)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 23:58:21 +00:00
0e53e88b02 haskell: thunks + force, app args become lazy (+6 tests, 333/333)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 23:22:21 +00:00
fba92c2b69 haskell: strict evaluator + 38 eval tests, Phase 2 complete (329/329)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 22:49:12 +00:00
1aa06237f1 haskell: value-level pattern matcher (+31 tests, 281/281)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 22:15:13 +00:00
e9c8f803b5 haskell: runtime constructor registry (+24 tests, 250/250)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 21:45:51 +00:00
ef81fffb6f haskell: desugar guards/where/list-comp → core AST (+15 tests, 226/226)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 21:16:53 +00:00
cab7ca883f haskell: operator sections + list comprehensions, Phase 1 parser complete (+22 tests, 211/211)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:47:51 +00:00
bf0d72fd2f haskell: module header + imports (+16 tests, 189/189)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:08:30 +00:00
defbe0a612 haskell: guards + where clauses (+11 tests, 173/173)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:37:52 +00:00
869b0b552d haskell: top-level decls (fn-clause, type-sig, data, type, newtype, fixity) + type parser (+24 tests, 162/162)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:06:38 +00:00
58dbbc5d8b haskell: full patterns — as/lazy/negative/infix + lambda & let pat LHS (+18 tests, 138/138)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:34:47 +00:00
36234f0132 haskell: case/do + minimal patterns (+19 tests, 119/119)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:00:58 +00:00
6ccef45ce4 haskell: expression parser + precedence climbing (+42 tests, 100/100)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:31:38 +00:00
c07ff90f6b haskell: layout rule per §10.3 (+15 tests, 58/58)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:05:35 +00:00
99753580b4 Recover agent-loop progress: lua/prolog/forth/erlang/haskell phases 1-2
Salvaged from worktree-agent-* branches killed during sx-tree MCP outage:
- lua: tokenizer + parser + phase-2 transpile (~157 tests)
- prolog: tokenizer + parser + unification (72 tests, plan update lost to WIP)
- forth: phase-1 reader/interpreter + phase-2 colon/VARIABLE (134 tests)
- erlang: tokenizer + parser (114 tests)
- haskell: tokenizer + parse tests (43 tests)

Cherry-picked file contents only, not branch history, to avoid pulling in
unrelated ocaml-vm merge commits that were in those branches' bases.
2026-04-24 16:03:00 +00:00
b45a69b7a4 sx: format_number helper — defuse int_of_float overflow on huge floats
Shared formatter in sx_types.ml. Small integer-valued floats still print
as plain ints; floats outside safe-int range (|n| >= 1e16) now print as
%.17g (full precision) instead of silently wrapping to negative or 0.
Non-integer values keep %g 6-digit behavior — no existing SX tests regress.

Unblocks Number.MAX_VALUE / Math.pow(2,N) style tests in js-on-sx where
iterative float loops were collapsing to 0 at ~2^63.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:09:11 +00:00
8f202e03c2 js-on-sx: .constructor backlink on Number/String/Array/Object protos (+1)
Number.prototype.constructor === Number etc. Four dict-set! lines add
the backlink after each constructor dict is defined.

new String().constructor === String now returns true. Array literals
don't yet link to Array.prototype so [].constructor === Array is still
false — that would need a boxing refactor.

Unit 521/522, slice 148/148 unchanged.
Number 76/100 → 77/100 (+1). String variance-heavy under CPU load.
2026-04-24 14:18:18 +00:00