summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/phase
diff options
context:
space:
mode:
authorNadrieril2020-01-24 17:07:56 +0000
committerNadrieril2020-01-24 17:07:56 +0000
commit700ff482fbff8960bc0e792fec6fd538c5428d70 (patch)
tree61e28733bcddd1287a7eef64f89d2d04181038df /dhall/src/semantics/phase
parentbd1eb36503aa6e03532fefcfd0c4f27eb62c99d2 (diff)
Normalize more expressions
Diffstat (limited to 'dhall/src/semantics/phase')
-rw-r--r--dhall/src/semantics/phase/normalize.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/dhall/src/semantics/phase/normalize.rs b/dhall/src/semantics/phase/normalize.rs
index 8f3953d..ac60ce0 100644
--- a/dhall/src/semantics/phase/normalize.rs
+++ b/dhall/src/semantics/phase/normalize.rs
@@ -594,10 +594,14 @@ fn apply_binop<'a>(
Ret::ValueKind(RecordLit(kvs))
}
- (RecursiveRecordTypeMerge, _, _) | (Equivalence, _, _) => {
+ (RecursiveRecordTypeMerge, _, _) => {
unreachable!("This case should have been handled in typecheck")
}
+ (Equivalence, _, _) => {
+ Ret::ValueKind(ValueKind::Equivalence(x.clone(), y.clone()))
+ }
+
_ => return None,
})
}
@@ -690,13 +694,6 @@ pub(crate) fn normalize_one_layer(
}
}
}
- // ExprKind::BinOp(RecursiveRecordTypeMerge, l, r) => { }
- // ExprKind::BinOp(Equivalence, l, r) => {
- // RetWhole(Value::from_kind_and_type(
- // ValueKind::Equivalence(l.clone(), r.clone()),
- // Value::from_const(Type),
- // ))
- // }
ExprKind::BinOp(o, ref x, ref y) => match apply_binop(o, x, y, ty) {
Some(ret) => ret,
None => Ret::Expr(expr),