File tree Expand file tree Collapse file tree 3 files changed +28
-78
lines changed Expand file tree Collapse file tree 3 files changed +28
-78
lines changed Original file line number Diff line number Diff line change @@ -216,24 +216,22 @@ export function insertAVL<TKey, TValue>(
216
216
if ( cmp === 0 ) {
217
217
// we replaced this node entirely
218
218
updated = subtree ;
219
- } else {
220
- if ( direction === "L" ) {
221
- updated = createAVLNode (
222
- node . key ,
223
- node . value ,
224
- node . height ,
225
- subtree ,
226
- node . right ,
227
- ) ;
228
- } else if ( direction === "R" ) {
229
- updated = createAVLNode (
230
- node . key ,
231
- node . value ,
232
- node . height ,
233
- node . left ,
234
- subtree ,
235
- ) ;
236
- }
219
+ } else if ( direction === "L" ) {
220
+ updated = createAVLNode (
221
+ node . key ,
222
+ node . value ,
223
+ node . height ,
224
+ subtree ,
225
+ node . right ,
226
+ ) ;
227
+ } else if ( direction === "R" ) {
228
+ updated = createAVLNode (
229
+ node . key ,
230
+ node . value ,
231
+ node . height ,
232
+ node . left ,
233
+ subtree ,
234
+ ) ;
237
235
}
238
236
}
239
237
Original file line number Diff line number Diff line change @@ -158,51 +158,3 @@ export function typedTypeRebuild(
158
158
) ;
159
159
}
160
160
}
161
-
162
- export function typedTypeRebuildTerm ( n : TripLangTerm ) : TripLangTerm {
163
- switch ( n . kind ) {
164
- case "poly" :
165
- case "typed" :
166
- case "untyped" :
167
- case "combinator" :
168
- return n ;
169
- case "type" :
170
- throw new CompilationError (
171
- `Unexpected kind: ${ JSON . stringify ( n ) } ` ,
172
- "resolve" ,
173
- { term : n } ,
174
- ) ;
175
- }
176
- }
177
-
178
- export function untypedTermRebuild ( n : TripLangTerm ) : TripLangTerm {
179
- switch ( n . kind ) {
180
- case "poly" :
181
- case "typed" :
182
- case "untyped" :
183
- case "combinator" :
184
- return n ;
185
- case "type" :
186
- throw new CompilationError (
187
- `Unexpected kind ${ JSON . stringify ( n ) } ` ,
188
- "resolve" ,
189
- { term : n } ,
190
- ) ;
191
- }
192
- }
193
-
194
- export function untypedTypeRebuild ( n : TripLangTerm ) : TripLangTerm {
195
- switch ( n . kind ) {
196
- case "poly" :
197
- case "typed" :
198
- case "untyped" :
199
- case "combinator" :
200
- return n ;
201
- case "type" :
202
- throw new CompilationError (
203
- `Unexpected kind: ${ JSON . stringify ( n ) } ` ,
204
- "resolve" ,
205
- { term : n } ,
206
- ) ;
207
- }
208
- }
Original file line number Diff line number Diff line change @@ -14,23 +14,23 @@ poly pair = ΛA . ΛB .
14
14
ΛY . λk : A → B → Y .
15
15
k a b
16
16
17
- poly fst = ΛA . ΛB .
18
- λp : ∀Y . (A → B → Y) → Y .
19
- p [A] (λx : A . λy : B . x)
17
+ poly fst = ΛA . ΛB .
18
+ λp : ∀Y . (A → B → Y) → Y .
19
+ p [A] (λx : A . λy : B . x)
20
20
21
- poly snd = ΛA . ΛB .
22
- λp : ∀Y . (A → B → Y) → Y .
23
- p [B] (λx : A . λy : B . y)
21
+ poly snd = ΛA . ΛB .
22
+ λp : ∀Y . (A → B → Y) → Y .
23
+ p [B] (λx : A . λy : B . y)
24
24
25
25
poly pred = λn : Nat .
26
26
fst Nat Nat
27
27
( n [∀Y . (Nat → Nat → Y) → Y]
28
- ( λp : ∀Y . (Nat → Nat → Y) → Y .
29
- pair Nat Nat
30
- (snd Nat Nat p)
31
- (succ (snd Nat Nat p))
32
- )
33
- (pair Nat Nat zero zero)
28
+ ( λp : ∀Y . (Nat → Nat → Y) → Y .
29
+ pair Nat Nat
30
+ (snd Nat Nat p)
31
+ (succ (snd Nat Nat p))
32
+ )
33
+ (pair Nat Nat zero zero)
34
34
)
35
35
36
36
poly testPred1 = pred one
You can’t perform that action at this time.
0 commit comments