From a928c3c4f51d87fd942e8a81727962c00abf6808 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 29 Jan 2020 22:06:01 +0000 Subject: Cleanup variable handling --- dhall/src/semantics/core/var.rs | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 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 3458489..264b81d 100644 --- a/dhall/src/semantics/core/var.rs +++ b/dhall/src/semantics/core/var.rs @@ -1,16 +1,4 @@ -use crate::syntax::{Label, V}; - -/// Stores an alpha-normalized variable. -#[derive(Clone, Copy, Eq)] -pub struct AlphaVar { - alpha: V<()>, -} -// TODO: temporary hopefully -impl std::cmp::PartialEq for AlphaVar { - fn eq(&self, _other: &Self) -> bool { - true - } -} +use crate::syntax::Label; // Exactly like a Label, but equality returns always true. // This is so that ValueKind equality is exactly alpha-equivalence. @@ -19,18 +7,6 @@ pub struct Binder { name: Label, } -impl AlphaVar { - pub(crate) fn new(alpha: V<()>) -> Self { - AlphaVar { alpha } - } - pub(crate) fn default() -> Self { - AlphaVar { alpha: V((), 0) } - } - pub(crate) fn idx(&self) -> usize { - self.alpha.idx() - } -} - impl Binder { pub(crate) fn new(name: Label) -> Self { Binder { name } @@ -47,12 +23,6 @@ impl std::cmp::PartialEq for Binder { } } -impl std::fmt::Debug for AlphaVar { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "AlphaVar({})", self.alpha.1) - } -} - impl std::fmt::Debug for Binder { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "Binder({})", &self.name) -- cgit v1.2.3