Files
rose-ash/lib/haskell/scoreboard.json
giles e83c01cdcc
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 44s
haskell: Phase 16 — exception handling (catch/try/throwIO/evaluate/handle/throw)
hk-bind-exceptions! in eval.sx registers throwIO, throw, evaluate, catch,
try, handle, displayException. SomeException constructor pre-registered
in runtime.sx (arity 1, type SomeException).

throwIO and the existing error primitive both raise via SX `raise` with a
uniform "hk-error: msg" string. catch/try/handle parse it back into a
SomeException via hk-exception-of, which strips nested
'Unhandled exception: "..."' host wraps (CEK's host_error formatter) and
the "hk-error: " prefix.

catch and handle evaluate the handler outside the guard scope (build an
"ok"/"exn" outcome tag inside guard, then dispatch outside) so that a
re-throw from the handler propagates past this catch — matching Haskell
semantics rather than infinite-looping in the same guard.

14 unit tests in tests/exceptions.sx (catch success, catch error, try
Right/Left, handle, throwIO + catch/try, evaluate, nested catch, do-bind
through catch, branch on try result, IORef-mutating handler).

Conformance: safediv.hs (8/8) and trycatch.hs (8/8). Scoreboard now
285/285 tests, 36/36 programs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 00:17:46 +00:00

44 lines
1.5 KiB
JSON

{
"date": "2026-05-08",
"total_pass": 285,
"total_fail": 0,
"programs": {
"fib": {"pass": 2, "fail": 0},
"sieve": {"pass": 2, "fail": 0},
"quicksort": {"pass": 5, "fail": 0},
"nqueens": {"pass": 2, "fail": 0},
"calculator": {"pass": 5, "fail": 0},
"collatz": {"pass": 11, "fail": 0},
"palindrome": {"pass": 12, "fail": 0},
"maybe": {"pass": 12, "fail": 0},
"fizzbuzz": {"pass": 12, "fail": 0},
"anagram": {"pass": 9, "fail": 0},
"roman": {"pass": 14, "fail": 0},
"binary": {"pass": 12, "fail": 0},
"either": {"pass": 12, "fail": 0},
"primes": {"pass": 12, "fail": 0},
"zipwith": {"pass": 9, "fail": 0},
"matrix": {"pass": 8, "fail": 0},
"wordcount": {"pass": 10, "fail": 0},
"powers": {"pass": 14, "fail": 0},
"caesar": {"pass": 8, "fail": 0},
"runlength-str": {"pass": 9, "fail": 0},
"showadt": {"pass": 5, "fail": 0},
"showio": {"pass": 5, "fail": 0},
"partial": {"pass": 7, "fail": 0},
"statistics": {"pass": 5, "fail": 0},
"newton": {"pass": 5, "fail": 0},
"wordfreq": {"pass": 7, "fail": 0},
"mapgraph": {"pass": 6, "fail": 0},
"uniquewords": {"pass": 4, "fail": 0},
"setops": {"pass": 8, "fail": 0},
"shapes": {"pass": 5, "fail": 0},
"person": {"pass": 7, "fail": 0},
"config": {"pass": 10, "fail": 0},
"counter": {"pass": 7, "fail": 0},
"accumulate": {"pass": 8, "fail": 0},
"safediv": {"pass": 8, "fail": 0},
"trycatch": {"pass": 8, "fail": 0}
}
}