From ab672506fd45e33f60b1b962c4757f912b6e27be Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 17 Jan 2020 18:31:45 +0000 Subject: Use alpha variables everywhere Don't bother keeping name around, it complicates matters --- dhall/src/semantics/core/value.rs | 2 +- dhall/src/semantics/core/var.rs | 30 +++++++++--------------------- dhall/src/semantics/to_expr.rs | 29 ++++++++++++++++++++++++----- 3 files changed, 34 insertions(+), 27 deletions(-) (limited to 'dhall') diff --git a/dhall/src/semantics/core/value.rs b/dhall/src/semantics/core/value.rs index 5aa337d..d843a1b 100644 --- a/dhall/src/semantics/core/value.rs +++ b/dhall/src/semantics/core/value.rs @@ -163,7 +163,7 @@ impl Value { &self, opts: to_expr::ToExprOptions, ) -> NormalizedExpr { - to_expr::value_to_expr(self, opts) + to_expr::value_to_expr(self, opts, &vec![]) } pub(crate) fn to_whnf_ignore_type(&self) -> ValueKind { self.as_whnf().clone() diff --git a/dhall/src/semantics/core/var.rs b/dhall/src/semantics/core/var.rs index d7666e3..f3475e7 100644 --- a/dhall/src/semantics/core/var.rs +++ b/dhall/src/semantics/core/var.rs @@ -2,12 +2,9 @@ use std::collections::HashMap; use crate::syntax::{Label, V}; -/// Stores a pair of variables: a normal one and one -/// that corresponds to the alpha-normalized version of the first one. -/// Equality is up to alpha-equivalence (compares on the second one only). +/// Stores an alpha-normalized variable. #[derive(Clone, Eq)] pub struct AlphaVar { - normal: V