From ec28905d32c23109da17696faefab284fde3e103 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 18 Jan 2020 18:46:09 +0000 Subject: Introduce intermediate representation that stores typed expr --- dhall/src/semantics/core/var.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'dhall/src/semantics/core/var.rs') diff --git a/dhall/src/semantics/core/var.rs b/dhall/src/semantics/core/var.rs index b336c66..0aa86d5 100644 --- a/dhall/src/semantics/core/var.rs +++ b/dhall/src/semantics/core/var.rs @@ -1,7 +1,7 @@ use crate::syntax::{Label, V}; /// Stores an alpha-normalized variable. -#[derive(Clone, Eq)] +#[derive(Clone, Copy, PartialEq, Eq)] pub struct AlphaVar { alpha: V<()>, } @@ -36,27 +36,11 @@ impl Binder { pub(crate) fn new(name: Label) -> Self { Binder { name } } - pub(crate) fn to_label_maybe_alpha(&self, alpha: bool) -> Label { - if alpha { - "_".into() - } else { - self.to_label() - } - } pub(crate) fn to_label(&self) -> Label { self.clone().into() } - pub(crate) fn name(&self) -> &Label { - &self.name - } } -/// Equality up to alpha-equivalence -impl std::cmp::PartialEq for AlphaVar { - fn eq(&self, other: &Self) -> bool { - self.alpha == other.alpha - } -} /// Equality up to alpha-equivalence impl std::cmp::PartialEq for Binder { fn eq(&self, _other: &Self) -> bool { -- cgit v1.2.3