haskell: Phase 10 — math builtins (sqrt/floor/ceiling/round/truncate) (+6 tests, 28/28)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m15s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m15s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -789,6 +789,26 @@
|
||||
(dict-set! hk-vfs (hk-force path) (hk-force contents))
|
||||
(list "IO" (list "Tuple"))))
|
||||
2))
|
||||
(dict-set! env "sqrt" (hk-mk-builtin "sqrt" (fn (x) (sqrt x)) 1))
|
||||
(dict-set!
|
||||
env
|
||||
"floor"
|
||||
(hk-mk-builtin "floor" (fn (x) (floor x)) 1))
|
||||
(dict-set!
|
||||
env
|
||||
"ceiling"
|
||||
(hk-mk-builtin
|
||||
"ceiling"
|
||||
(fn (x) (let ((f (floor x))) (if (= x f) f (+ f 1))))
|
||||
1))
|
||||
(dict-set!
|
||||
env
|
||||
"round"
|
||||
(hk-mk-builtin "round" (fn (x) (round x)) 1))
|
||||
(dict-set!
|
||||
env
|
||||
"truncate"
|
||||
(hk-mk-builtin "truncate" (fn (x) (truncate x)) 1))
|
||||
(let
|
||||
((--sx-to-hk-- (fn (lst) (if (empty? lst) (list "[]") (list ":" (first lst) (--sx-to-hk-- (rest lst))))))
|
||||
(--words--
|
||||
|
||||
Reference in New Issue
Block a user