HS runtime: add Set/Map coercions to hs-coerce

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-16 15:28:29 +00:00
parent 6f374fabce
commit 4981e9a32f
2 changed files with 30 additions and 0 deletions

View File

@@ -355,6 +355,21 @@
(list)
value)
value))
((= type-name "Set")
(if
(list? value)
(reduce
(fn
(acc x)
(if (some (fn (a) (= a x)) acc) acc (append acc (list x))))
(list)
value)
value))
((= type-name "Map")
(if
(dict? value)
(map (fn (k) (list k (get value k))) (keys value))
value))
(true value))))
(define