From a7363042a16364a6dafdd545f4069dcf04a4197e Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 27 Aug 2019 23:18:13 +0200 Subject: Rename SubExpr to Expr, and Expr to RawExpr For clarity, and consistency with Value --- dhall/src/core/value.rs | 8 ++++---- dhall/src/core/valuef.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'dhall/src/core') diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs index 21ac288..49e30cd 100644 --- a/dhall/src/core/value.rs +++ b/dhall/src/core/value.rs @@ -9,7 +9,7 @@ use crate::core::var::{AlphaVar, Shift, Subst}; use crate::error::{TypeError, TypeMessage}; use crate::phase::normalize::{apply_any, normalize_whnf}; use crate::phase::typecheck::{builtin_to_value, const_to_value}; -use crate::phase::{NormalizedSubExpr, Typed}; +use crate::phase::{NormalizedExpr, Typed}; #[derive(Debug, Clone, Copy)] pub(crate) enum Form { @@ -166,11 +166,11 @@ impl Value { } // TODO: rename `normalize_to_expr` - pub(crate) fn to_expr(&self) -> NormalizedSubExpr { + pub(crate) fn to_expr(&self) -> NormalizedExpr { self.as_whnf().normalize_to_expr() } // TODO: rename `normalize_to_expr_maybe_alpha` - pub(crate) fn to_expr_alpha(&self) -> NormalizedSubExpr { + pub(crate) fn to_expr_alpha(&self) -> NormalizedExpr { self.as_whnf().normalize_to_expr_maybe_alpha(true) } pub(crate) fn to_whnf_ignore_type(&self) -> ValueF { @@ -226,7 +226,7 @@ impl Value { pub(crate) fn normalize_to_expr_maybe_alpha( &self, alpha: bool, - ) -> NormalizedSubExpr { + ) -> NormalizedExpr { self.as_nf().normalize_to_expr_maybe_alpha(alpha) } diff --git a/dhall/src/core/valuef.rs b/dhall/src/core/valuef.rs index 9ea2467..959f299 100644 --- a/dhall/src/core/valuef.rs +++ b/dhall/src/core/valuef.rs @@ -7,7 +7,7 @@ use dhall_syntax::{ use crate::core::value::Value; use crate::core::var::{AlphaLabel, AlphaVar, Shift, Subst}; -use crate::phase::{Normalized, NormalizedSubExpr}; +use crate::phase::{Normalized, NormalizedExpr}; /// A semantic value. Subexpressions are Values, which are partially evaluated expressions that are /// normalized on-demand. @@ -52,7 +52,7 @@ impl ValueF { } /// Convert the value to a fully normalized syntactic expression - pub(crate) fn normalize_to_expr(&self) -> NormalizedSubExpr { + pub(crate) fn normalize_to_expr(&self) -> NormalizedExpr { self.normalize_to_expr_maybe_alpha(false) } /// Convert the value to a fully normalized syntactic expression. Also alpha-normalize @@ -60,7 +60,7 @@ impl ValueF { pub(crate) fn normalize_to_expr_maybe_alpha( &self, alpha: bool, - ) -> NormalizedSubExpr { + ) -> NormalizedExpr { match self { ValueF::Lam(x, t, e) => rc(ExprF::Lam( x.to_label_maybe_alpha(alpha), -- cgit v1.2.3