From db6c09f33c3c794e4b6ec8a7aa80978d945a9d7a Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 29 Jan 2020 21:26:42 +0000 Subject: Remove dead code --- dhall/src/semantics/core/value.rs | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'dhall/src/semantics/core/value.rs') diff --git a/dhall/src/semantics/core/value.rs b/dhall/src/semantics/core/value.rs index aa819d2..30c4116 100644 --- a/dhall/src/semantics/core/value.rs +++ b/dhall/src/semantics/core/value.rs @@ -68,8 +68,6 @@ pub(crate) enum Closure { #[derive(Debug, Clone, PartialEq, Eq)] pub(crate) enum ValueKind { /// Closures - Lam(Binder, Value, Value), - Pi(Binder, Value, Value), LamClosure { binder: Binder, annot: Value, @@ -133,13 +131,6 @@ impl Value { pub(crate) fn from_kind_and_type(v: ValueKind, t: Value) -> Value { Value::new(v, Unevaled, t, Span::Artificial) } - pub(crate) fn from_kind_and_type_and_span( - v: ValueKind, - t: Value, - span: Span, - ) -> Value { - Value::new(v, Unevaled, t, span) - } pub(crate) fn from_kind_and_type_whnf( v: ValueKind, t: Value, @@ -155,10 +146,6 @@ impl Value { pub(crate) fn from_builtin_env(b: Builtin, env: &NzEnv) -> Self { builtin_to_value_env(b, env) } - pub(crate) fn with_span(self, span: Span) -> Self { - self.as_internal_mut().span = span; - self - } pub(crate) fn as_const(&self) -> Option { match &*self.as_whnf() { @@ -238,10 +225,6 @@ impl Value { pub(crate) fn app(&self, v: Value) -> Value { let body_t = match &*self.get_type_not_sort().as_whnf() { - ValueKind::Pi(_, t, e) => { - v.check_type(t); - e.subst_shift(&AlphaVar::default(), &v) - } ValueKind::PiClosure { annot, closure, .. } => { v.check_type(annot); closure.apply(v.clone()) @@ -276,9 +259,6 @@ impl Value { pub(crate) fn shift(&self, delta: isize, var: &AlphaVar) -> Option { Some(self.as_internal().shift(delta, var)?.into_value()) } - pub(crate) fn over_binder(&self) -> Option { - self.shift(-1, &AlphaVar::default()) - } pub(crate) fn under_binder(&self) -> Self { // Can't fail since delta is positive self.shift(1, &AlphaVar::default()).unwrap() @@ -398,10 +378,6 @@ impl Value { | ValueKind::AppliedBuiltin(..) | ValueKind::UnionConstructor(..) | ValueKind::UnionLit(..) => unreachable!(), - ValueKind::Lam(x, t, e) => { - ExprKind::Lam(x.to_label(), t, e) - } - ValueKind::Pi(x, t, e) => ExprKind::Pi(x.to_label(), t, e), ValueKind::Const(c) => ExprKind::Const(c), ValueKind::BoolLit(b) => ExprKind::BoolLit(b), ValueKind::NaturalLit(n) => ExprKind::NaturalLit(n), @@ -555,14 +531,6 @@ impl ValueKind { ValueKind::NEOptionalLit(th) => { th.normalize_mut(); } - ValueKind::Lam(_, t, e) => { - t.normalize_mut(); - e.normalize_mut(); - } - ValueKind::Pi(_, t, e) => { - t.normalize_mut(); - e.normalize_mut(); - } ValueKind::LamClosure { annot, .. } | ValueKind::PiClosure { annot, .. } => { annot.normalize_mut(); -- cgit v1.2.3