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>
This commit is contained in:
2026-05-06 21:45:23 +00:00
parent f6efba410a
commit 685fcd11d5
4 changed files with 106 additions and 8 deletions

View File

@@ -432,12 +432,14 @@
hk-list-append
(fn
(a b)
(cond
((hk-str? a) (str (hk-str-to-native a) (hk-str-to-native b)))
((and (list? a) (= (first a) "[]")) b)
((and (list? a) (= (first a) ":"))
(hk-mk-cons (nth a 1) (hk-list-append (nth a 2) b)))
(:else (raise "++: not a list")))))
(let
((a (hk-force a)))
(cond
((hk-str? a) (str (hk-str-to-native a) (hk-str-to-native b)))
((and (list? a) (= (first a) "[]")) b)
((and (list? a) (= (first a) ":"))
(hk-mk-cons (nth a 1) (hk-list-append (nth a 2) b)))
(:else (raise "++: not a list"))))))
;; Eager finite-range spine — handles [from..to] and [from,next..to].
;; Step direction is governed by the sign of `step`; when step > 0 we