diff options
author | Nadrieril | 2019-08-16 18:14:55 +0200 |
---|---|---|
committer | Nadrieril | 2019-08-16 18:14:55 +0200 |
commit | 5f0d69671b44ba1dff6becb9ebc7f6e74241e3e2 (patch) | |
tree | 043c93ec1acf36d034d4706eaf32f47873ba45b7 /dhall/src/core/context.rs | |
parent | 51bb1d2da8e5874129d4b5cc5d0c60e23eee9f11 (diff) |
Remove dead code
Diffstat (limited to 'dhall/src/core/context.rs')
-rw-r--r-- | dhall/src/core/context.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/dhall/src/core/context.rs b/dhall/src/core/context.rs index 9230a2e..3c07c1c 100644 --- a/dhall/src/core/context.rs +++ b/dhall/src/core/context.rs @@ -19,9 +19,6 @@ enum CtxItem<T> { struct Context<T>(Rc<Vec<(Label, CtxItem<T>)>>); #[derive(Debug, Clone)] -pub(crate) struct NormalizationContext(Context<()>); - -#[derive(Debug, Clone)] pub(crate) struct TypecheckContext(Context<Type>); impl<T> Context<T> { @@ -117,22 +114,6 @@ impl<T> Context<T> { } } -impl NormalizationContext { - pub fn new() -> Self { - NormalizationContext(Context::new()) - } - pub fn skip(&self, x: &Label) -> Self { - NormalizationContext(self.0.insert_kept(x, ())) - } - pub fn lookup(&self, var: &V<Label>) -> Value { - match self.0.lookup(var) { - Ok(CtxItem::Replaced(t, ())) => t.to_value(), - Ok(CtxItem::Kept(newvar, ())) => Value::Var(newvar.clone()), - Err(var) => Value::Var(AlphaVar::from_var(var)), - } - } -} - impl TypecheckContext { pub fn new() -> Self { TypecheckContext(Context::new()) @@ -180,12 +161,6 @@ impl<T: Clone + Shift> Shift for Context<T> { } } -impl Shift for NormalizationContext { - fn shift(&self, delta: isize, var: &AlphaVar) -> Option<Self> { - Some(NormalizationContext(self.0.shift(delta, var)?)) - } -} - impl<T: Subst<Typed>> Subst<Typed> for CtxItem<T> { fn subst_shift(&self, var: &AlphaVar, val: &Typed) -> Self { match self { @@ -209,12 +184,6 @@ impl<T: Clone + Subst<Typed>> Subst<Typed> for Context<T> { } } -impl Subst<Typed> for NormalizationContext { - fn subst_shift(&self, var: &AlphaVar, val: &Typed) -> Self { - NormalizationContext(self.0.subst_shift(var, val)) - } -} - impl PartialEq for TypecheckContext { fn eq(&self, _: &Self) -> bool { // don't count contexts when comparing stuff |