Skip to content

Commit dc8a269

Browse files
committed
Add tests for declarations
1 parent ca30c7c commit dc8a269

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#lang hackett
2+
3+
(require hackett/private/test)
4+
5+
(⋮ f {Integer -> Integer})
6+
(def f (λ [x] (id x)))
7+
8+
(⋮ fact {Integer -> Integer})
9+
(defn fact
10+
[[0] 1]
11+
[[n] {n * (fact {n - 1})}])
12+
13+
(⋮ id (forall [a] {a -> a}))
14+
(defn id
15+
[[x] (: x a)])
16+
17+
(⋮ rmt (forall [a b] (Monoid b) => (Either a b)))
18+
(def rmt (Right (: mempty b)))
19+
20+
(test {rmt ==! (: (Right "") (Either Unit String))})
21+
(test {rmt ==! (: (Right Nil) (Either Bool (List Integer)))})
22+

0 commit comments

Comments
 (0)