From 2075cba6d883278a534afd2d8fe8f0a5e9b2f0d0 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 6 May 2019 00:42:15 +0200 Subject: Merge TypedInternal and Typed --- dhall/src/normalize.rs | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'dhall/src/normalize.rs') diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs index 35ab45d..1d306bc 100644 --- a/dhall/src/normalize.rs +++ b/dhall/src/normalize.rs @@ -9,7 +9,7 @@ use dhall_syntax::{ Natural, Span, SubExpr, V, X, }; -use crate::expr::{Normalized, Type, Typed, TypedInternal}; +use crate::expr::{Normalized, Type, Typed}; type InputSubExpr = SubExpr; type OutputSubExpr = SubExpr; @@ -25,29 +25,13 @@ impl Typed { /// leave ill-typed sub-expressions unevaluated. /// pub fn normalize(self) -> Normalized { - match &self.0 { - TypedInternal::Sort => {} - TypedInternal::Value(thunk, _) => { + match &self { + Typed::Sort => {} + Typed::Value(thunk, _) => { thunk.normalize_nf(); } } - Normalized(self.0) - } - - pub(crate) fn shift(&self, delta: isize, var: &AlphaVar) -> Self { - Typed(self.0.shift(delta, var)) - } - - pub(crate) fn subst_shift(&self, var: &AlphaVar, val: &Typed) -> Self { - Typed(self.0.subst_shift(var, val)) - } - - pub(crate) fn to_value(&self) -> Value { - self.0.to_value() - } - - pub(crate) fn to_thunk(&self) -> Thunk { - self.0.to_thunk() + Normalized(self) } } -- cgit v1.2.3