haskell: Phase 13 — Ord default verification (myMax/myMin) (+5 tests, 10/10)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 59s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 13:36:39 +00:00
parent 8dfb3f6387
commit ebbf0fc10c
2 changed files with 35 additions and 1 deletions

View File

@@ -35,4 +35,33 @@
"class Hi a where\n greet :: a -> String\n greet x = \"default\"\ninstance Hi Bool where\nmain = greet True"))
"default")
(define
hk-myord-source
"class MyOrd a where\n myCmp :: a -> a -> Bool\n myMax :: a -> a -> a\n myMin :: a -> a -> a\n myMax a b = if myCmp a b then a else b\n myMin a b = if myCmp a b then b else a\ninstance MyOrd Int where\n myCmp x y = x >= y\n")
(hk-test
"Ord default: myMax 3 5 = 5"
(hk-deep-force (hk-run (str hk-myord-source "main = myMax 3 5\n")))
5)
(hk-test
"Ord default: myMax 8 2 = 8"
(hk-deep-force (hk-run (str hk-myord-source "main = myMax 8 2\n")))
8)
(hk-test
"Ord default: myMin 3 5 = 3"
(hk-deep-force (hk-run (str hk-myord-source "main = myMin 3 5\n")))
3)
(hk-test
"Ord default: myMin 8 2 = 2"
(hk-deep-force (hk-run (str hk-myord-source "main = myMin 8 2\n")))
2)
(hk-test
"Ord default: myMax of equals returns first"
(hk-deep-force (hk-run (str hk-myord-source "main = myMax 4 4\n")))
4)
{:fails hk-test-fails :pass hk-test-pass :fail hk-test-fail}