summaryrefslogtreecommitdiff
path: root/dhall/src/expr.rs
diff options
context:
space:
mode:
authorNadrieril2019-04-06 20:50:57 +0200
committerNadrieril2019-04-06 20:50:57 +0200
commit7983c43210f5fcaa439fa1c6742e72252652e4f4 (patch)
tree28d88eaa2e0a35d2d3867994b88afeff1eb910d4 /dhall/src/expr.rs
parent412d0fac51b7b51aabcb049e3d6ba52f3dda1529 (diff)
Thread Typed through type_with
Diffstat (limited to 'dhall/src/expr.rs')
-rw-r--r--dhall/src/expr.rs34
1 files changed, 9 insertions, 25 deletions
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<X, Import>, pub(crate) ImportRoot);
pub struct Resolved(pub(crate) SubExpr<X, X>);
#[derive(Debug, Clone)]
-pub struct Typed(pub(crate) SubExpr<X, X>, Type);
+pub struct Typed(pub(crate) SubExpr<X, X>, pub(crate) Type);
-#[derive(Debug, Clone)]
-pub struct Type(pub(crate) Box<Normalized>);
+// #[derive(Debug, Clone)]
+// pub struct Type(pub(crate) Box<Normalized>);
+pub type Type = SubExpr<X, X>;
#[derive(Debug, Clone)]
pub struct Normalized(pub(crate) SubExpr<X, X>);
@@ -28,24 +28,8 @@ impl std::fmt::Display for Parsed {
}
}
-impl Resolved {
- pub fn typecheck(self) -> Result<Typed, TypeError<X>> {
- 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
+// }
+// }