From 7983c43210f5fcaa439fa1c6742e72252652e4f4 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 6 Apr 2019 20:50:57 +0200 Subject: Thread Typed through type_with --- dhall/src/expr.rs | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'dhall/src/expr.rs') diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs index ae52e4d..cc7f064 100644 --- a/dhall/src/expr.rs +++ b/dhall/src/expr.rs @@ -1,5 +1,4 @@ use crate::imports::ImportRoot; -use crate::typecheck::TypeError; use dhall_core::*; #[derive(Debug, Clone, Eq)] @@ -9,10 +8,11 @@ pub struct Parsed(pub(crate) SubExpr, pub(crate) ImportRoot); pub struct Resolved(pub(crate) SubExpr); #[derive(Debug, Clone)] -pub struct Typed(pub(crate) SubExpr, Type); +pub struct Typed(pub(crate) SubExpr, pub(crate) Type); -#[derive(Debug, Clone)] -pub struct Type(pub(crate) Box); +// #[derive(Debug, Clone)] +// pub struct Type(pub(crate) Box); +pub type Type = SubExpr; #[derive(Debug, Clone)] pub struct Normalized(pub(crate) SubExpr); @@ -28,24 +28,8 @@ impl std::fmt::Display for Parsed { } } -impl Resolved { - pub fn typecheck(self) -> Result> { - let typ = Type(Box::new(Normalized(crate::typecheck::type_of( - self.0.clone(), - )?))); - Ok(Typed(self.0, typ)) - } -} -impl Typed { - pub fn normalize(self) -> Normalized { - Normalized(crate::normalize::normalize(self.0)) - } - pub fn get_type(&self) -> &Type { - &self.1 - } -} -impl Type { - pub fn as_expr(&self) -> &Normalized { - &*self.0 - } -} +// impl Type { +// pub fn as_expr(&self) -> &Normalized { +// &*self.0 +// } +// } -- cgit v1.2.3