summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/nze/value.rs
diff options
context:
space:
mode:
authorNadrieril2020-02-09 11:58:11 +0000
committerNadrieril2020-02-09 20:13:23 +0000
commit5688ed654eee258bf8ffc8761ce693c73a0242d5 (patch)
treefa9240d0feb37260749ebae76f41a178a1fdd4ad /dhall/src/semantics/nze/value.rs
parent6c90d356c9a4a5bbeb88f25ad0ab499ba1503eae (diff)
Remove extra types stored in Value
Diffstat (limited to '')
-rw-r--r--dhall/src/semantics/nze/value.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/dhall/src/semantics/nze/value.rs b/dhall/src/semantics/nze/value.rs
index d05c545..a771b91 100644
--- a/dhall/src/semantics/nze/value.rs
+++ b/dhall/src/semantics/nze/value.rs
@@ -93,10 +93,8 @@ pub(crate) enum ValueKind {
RecordType(HashMap<Label, Value>),
RecordLit(HashMap<Label, Value>),
UnionType(HashMap<Label, Option<Value>>),
- // Also keep the type of the uniontype around
- UnionConstructor(Label, HashMap<Label, Option<Value>>, Value),
- // Also keep the type of the uniontype and the constructor around
- UnionLit(Label, Value, HashMap<Label, Option<Value>>, Value, Value),
+ UnionConstructor(Label, HashMap<Label, Option<Value>>),
+ UnionLit(Label, Value, HashMap<Label, Option<Value>>),
TextLit(TextLit),
Equivalence(Value, Value),
/// Invariant: evaluation must not be able to progress with `normalize_one_layer`?
@@ -298,14 +296,14 @@ impl Value {
.collect(),
),
ValueKind::UnionType(kts) => map_uniontype(kts),
- ValueKind::UnionConstructor(l, kts, t) => ExprKind::Field(
+ ValueKind::UnionConstructor(l, kts) => ExprKind::Field(
Hir::new(
HirKind::Expr(map_uniontype(kts)),
Span::Artificial,
),
l.clone(),
),
- ValueKind::UnionLit(l, v, kts, uniont, ctort) => ExprKind::App(
+ ValueKind::UnionLit(l, v, kts) => ExprKind::App(
Hir::new(
HirKind::Expr(ExprKind::Field(
Hir::new(
@@ -418,13 +416,12 @@ impl ValueKind {
x.normalize();
}
}
- ValueKind::UnionType(kts)
- | ValueKind::UnionConstructor(_, kts, _) => {
+ ValueKind::UnionType(kts) | ValueKind::UnionConstructor(_, kts) => {
for x in kts.values().flat_map(|opt| opt) {
x.normalize();
}
}
- ValueKind::UnionLit(_, v, kts, _, _) => {
+ ValueKind::UnionLit(_, v, kts) => {
v.normalize();
for x in kts.values().flat_map(|opt| opt) {
x.normalize();