Skip to content

Commit d6330a5

Browse files
committed
simple lints
1 parent f30ee91 commit d6330a5

File tree

3 files changed

+28
-78
lines changed

3 files changed

+28
-78
lines changed

lib/data/avl/avlNode.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -216,24 +216,22 @@ export function insertAVL<TKey, TValue>(
216216
if (cmp === 0) {
217217
// we replaced this node entirely
218218
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+
);
237235
}
238236
}
239237

lib/meta/frontend/rebuilders.ts

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -158,51 +158,3 @@ export function typedTypeRebuild(
158158
);
159159
}
160160
}
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-
}

test/meta/inputs/pred.trip

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ poly pair = ΛA . ΛB .
1414
ΛY . λk : A → B → Y .
1515
k a b
1616

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)
2020

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)
2424

2525
poly pred = λn : Nat .
2626
fst Nat Nat
2727
( 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)
3434
)
3535

3636
poly testPred1 = pred one

0 commit comments

Comments
 (0)