Fix type-check-strict compiler match + deploy HS to WASM
- Compiler match for type-check-strict was still using old name type-check! - Deploy updated HS source files to shared/static/wasm/sx/ - Sandbox runner validates 16/16 hard cases pass with cek-eval (no runtime let-binding hacks needed in WASM context) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -284,7 +284,7 @@
|
||||
(true true)))))
|
||||
|
||||
(define
|
||||
hs-type-check!
|
||||
hs-type-check-strict
|
||||
(fn
|
||||
(value type-name)
|
||||
(if (nil? value) false (hs-type-check value type-name))))
|
||||
@@ -295,7 +295,15 @@
|
||||
|
||||
(define
|
||||
hs-falsy?
|
||||
(fn (v) (or (nil? v) (= v false) (and (string? v) (= v "")))))
|
||||
(fn
|
||||
(v)
|
||||
(cond
|
||||
((nil? v) true)
|
||||
((= v false) true)
|
||||
((and (string? v) (= v "")) true)
|
||||
((and (list? v) (= (len v) 0)) true)
|
||||
((= v 0) true)
|
||||
(true false))))
|
||||
|
||||
(define
|
||||
hs-matches?
|
||||
@@ -311,6 +319,29 @@
|
||||
(fn
|
||||
(collection item)
|
||||
(cond
|
||||
((list? collection) (some (fn (x) (= x item)) collection))
|
||||
((string? collection) (string-contains? collection item))
|
||||
(true false))))
|
||||
((nil? collection) false)
|
||||
((string? collection) (string-contains? collection (str item)))
|
||||
((list? collection)
|
||||
(if
|
||||
(= (len collection) 0)
|
||||
false
|
||||
(if
|
||||
(= (first collection) item)
|
||||
true
|
||||
(hs-contains? (rest collection) item))))
|
||||
(true false))))
|
||||
|
||||
(define
|
||||
hs-empty?
|
||||
(fn
|
||||
(v)
|
||||
(cond
|
||||
((nil? v) true)
|
||||
((string? v) (= (len v) 0))
|
||||
((list? v) (= (len v) 0))
|
||||
((dict? v) (= (len (keys v)) 0))
|
||||
(true false))))
|
||||
|
||||
(define hs-first (fn (lst) (first lst)))
|
||||
|
||||
(define hs-last (fn (lst) (last lst)))
|
||||
Reference in New Issue
Block a user