@@ -28,8 +28,8 @@ TypeLevel: {
28
28
29
29
not: t -> t
30
30
31
- andAlso : t -> t -> t
32
- orElse : t -> t -> t
31
+ (&&&) : t -> t -> t
32
+ (|||) : t -> t -> t
33
33
34
34
equals: t -> t -> t
35
35
}
@@ -43,7 +43,7 @@ TypeLevel: {
43
43
isL: t -> Bool.t
44
44
isR: t -> Bool.t
45
45
46
- case: t -> t
46
+ case: (type _ _) -> (type _ _) -> t -> type
47
47
}
48
48
49
49
Nat: {
@@ -55,6 +55,7 @@ TypeLevel: {
55
55
one: t
56
56
57
57
succ: t -> t
58
+
58
59
(+): t -> t -> t
59
60
(*): t -> t -> t
60
61
}
@@ -80,10 +81,9 @@ TypeLevel: {
80
81
81
82
type of fst snd: t = fun (type d _ _) => d fst snd
82
83
83
- type cross (type f _) (type s _) (p: t): t = fun (type d _ _) =>
84
- of (f (fst p)) (s (snd p)) d
84
+ type cross (type f _) (type s _) (p: t): t = of (f (fst p)) (s (snd p))
85
85
86
- type map (type f _) (p: t): t = fun (type d _ _) => cross f f p d
86
+ type map (type f _) (p: t): t = cross f f p
87
87
}
88
88
89
89
Bool = {
@@ -94,8 +94,8 @@ TypeLevel: {
94
94
95
95
type not (x: t): t = fun true false => x false true
96
96
97
- type andAlso (l: t) (r: t): t = fun false true => l (r true false) false
98
- type orElse (l: t) (r: t): t = fun false true => l true (r true false)
97
+ type (l: t) &&& (r: t): t = fun false true => l (r true false) false
98
+ type (l: t) ||| (r: t): t = fun false true => l true (r true false)
99
99
100
100
type equals (l: t) (r: t): t =
101
101
fun true false => l (r true false) (r false true)
@@ -112,7 +112,7 @@ TypeLevel: {
112
112
type isR (a: t): Bool.t =
113
113
fun true false => a (fun _ => false) (fun _ => true)
114
114
115
- type case (a: t) ( type inL _) (type inR _) = a inL inR
115
+ type case (type inL _) (type inR _) (a: t): type = a inL inR
116
116
}
117
117
118
118
Nat = {
@@ -121,11 +121,12 @@ TypeLevel: {
121
121
type isZero (n: t): Bool.t = fun true false => n (fun _ => false) true
122
122
123
123
type zero: t = fun (type _ _) zero => zero
124
- type one: t = fun (type succ _) zero => succ zero
124
+ type one: t = fun (type succ _) => succ
125
125
126
- type succ (n: t): t = fun (type succ _) zero => succ (n succ zero)
127
126
type (m: t) + (n: t): t = fun (type succ _) zero => n succ (m succ zero)
128
- type (m: t) * (n: t): t = fun (type succ _) zero => n (m succ) zero
127
+ type (m: t) * (n: t): t = fun (type succ _) => n (m succ)
128
+
129
+ type succ = (+) one
129
130
}
130
131
131
132
List = {
0 commit comments