summaryrefslogtreecommitdiff
path: root/dhall/src
diff options
context:
space:
mode:
authorNadrieril2019-05-04 19:51:26 +0200
committerNadrieril2019-05-04 19:51:26 +0200
commit6792d3da32d11b5303b00d1cc667f6f946d8bf33 (patch)
tree03489613ec26f5a5559bb5b015a2d29a1bf15c53 /dhall/src
parentab100be616932dab22a5309df86107b66e93db37 (diff)
We actually don't need SubExpr::shift anymore
Diffstat (limited to 'dhall/src')
-rw-r--r--dhall/src/normalize.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs
index 8ae746d..d84c2d5 100644
--- a/dhall/src/normalize.rs
+++ b/dhall/src/normalize.rs
@@ -187,17 +187,18 @@ impl Value {
let a = n.normalize_to_expr();
dhall::subexpr!(λ(x: a) -> Some x)
}
- Value::ListConsClosure(n, None) => {
- let a = n.normalize_to_expr();
+ Value::ListConsClosure(a, None) => {
// Avoid accidental capture of the new `x` variable
let a1 = a.shift(1, &Label::from("x").into());
+ let a1 = a1.normalize_to_expr();
+ let a = a.normalize_to_expr();
dhall::subexpr!(λ(x : a) -> λ(xs : List a1) -> [ x ] # xs)
}
Value::ListConsClosure(n, Some(v)) => {
- let v = v.normalize_to_expr();
- let a = n.normalize_to_expr();
// Avoid accidental capture of the new `xs` variable
let v = v.shift(1, &Label::from("xs").into());
+ let v = v.normalize_to_expr();
+ let a = n.normalize_to_expr();
dhall::subexpr!(λ(xs : List a) -> [ v ] # xs)
}
Value::NaturalSuccClosure => {