We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
:
1 parent 68bf434 commit 854853bCopy full SHA for 854853b
hackett-test/tests/hackett/integration/id-decl.rkt
@@ -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