From ab93af7bb8bbe7785d76a86af531bae9b13574c4 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 19 Apr 2019 21:28:18 +0200 Subject: A union constructor is a purely semantic value --- dhall_core/src/core.rs | 2 -- dhall_core/src/printer.rs | 10 ---------- dhall_core/src/visitor.rs | 3 --- 3 files changed, 15 deletions(-) (limited to 'dhall_core/src') diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index ab29148..9a8acc2 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -192,8 +192,6 @@ pub enum ExprF { UnionType(BTreeMap>), /// `< k1 = t1, k2 : t2, k3 >` UnionLit(Label, SubExpr, BTreeMap>), - /// `< k1 : t1, k2 >.k1` - UnionConstructor(Label, BTreeMap>), /// `merge x y : t` Merge(SubExpr, SubExpr, Option), /// `e.x` diff --git a/dhall_core/src/printer.rs b/dhall_core/src/printer.rs index 85105d9..ea291a9 100644 --- a/dhall_core/src/printer.rs +++ b/dhall_core/src/printer.rs @@ -104,16 +104,6 @@ impl Display for ExprF { } f.write_str(" >")? } - UnionConstructor(x, map) => { - fmt_list("< ", " | ", " >", map, f, |(k, v), f| { - write!(f, "{}", k)?; - if let Some(v) = v { - write!(f, ": {}", v)?; - } - Ok(()) - })?; - write!(f, ".{}", x)? - } Embed(a) => a.fmt(f)?, Note(_, b) => b.fmt(f)?, } diff --git a/dhall_core/src/visitor.rs b/dhall_core/src/visitor.rs index 9111414..c15aacd 100644 --- a/dhall_core/src/visitor.rs +++ b/dhall_core/src/visitor.rs @@ -163,9 +163,6 @@ where v.visit_subexpr(x)?, btoptmap(kts, v)?, ), - UnionConstructor(x, kts) => { - UnionConstructor(v.visit_label(x)?, btoptmap(kts, v)?) - } Merge(x, y, t) => Merge( v.visit_subexpr(x)?, v.visit_subexpr(y)?, -- cgit v1.2.3