summaryrefslogtreecommitdiff
path: root/dhall/src/semantics
diff options
context:
space:
mode:
authorNadrieril2020-01-30 11:17:49 +0000
committerNadrieril2020-01-30 11:17:49 +0000
commit7743647137d1914c280e03d6aaee81e507cff97d (patch)
treebf9a7a4767decc929820b24b63c29e1b391a8719 /dhall/src/semantics
parent655f67fb29ca847f86c3e19338757e7b031d4f50 (diff)
Remove old typecheck module
Diffstat (limited to 'dhall/src/semantics')
-rw-r--r--dhall/src/semantics/phase/mod.rs17
-rw-r--r--dhall/src/semantics/phase/resolve.rs8
-rw-r--r--dhall/src/semantics/phase/typecheck.rs1
3 files changed, 5 insertions, 21 deletions
diff --git a/dhall/src/semantics/phase/mod.rs b/dhall/src/semantics/phase/mod.rs
index 2727a61..f24a668 100644
--- a/dhall/src/semantics/phase/mod.rs
+++ b/dhall/src/semantics/phase/mod.rs
@@ -2,9 +2,7 @@ use std::fmt::Display;
use std::path::Path;
use crate::error::{EncodeError, Error, ImportError, TypeError};
-use crate::semantics::core::value::Value;
-use crate::semantics::core::value::ValueKind;
-use crate::semantics::tck::tyexpr::TyExpr;
+use crate::semantics::{typecheck, typecheck_with, TyExpr, Value, ValueKind};
use crate::syntax::binary;
use crate::syntax::{Builtin, Const, Expr};
use resolve::ImportRoot;
@@ -12,7 +10,6 @@ use resolve::ImportRoot;
pub(crate) mod normalize;
pub(crate) mod parse;
pub(crate) mod resolve;
-pub(crate) mod typecheck;
pub type ParsedExpr = Expr<Normalized>;
pub type DecodedExpr = Expr<Normalized>;
@@ -80,23 +77,15 @@ impl Parsed {
impl Resolved {
pub fn typecheck(&self) -> Result<Typed, TypeError> {
- Ok(Typed(crate::semantics::tck::typecheck::typecheck(&self.0)?))
+ Ok(Typed(typecheck(&self.0)?))
}
pub fn typecheck_with(self, ty: &Normalized) -> Result<Typed, TypeError> {
- Ok(Typed(crate::semantics::tck::typecheck::typecheck_with(
- &self.0,
- ty.to_expr(),
- )?))
+ Ok(Typed(typecheck_with(&self.0, ty.to_expr())?))
}
/// Converts a value back to the corresponding AST expression.
pub fn to_expr(&self) -> ResolvedExpr {
self.0.clone()
}
- pub fn tck_and_normalize_new_flow(&self) -> Result<Normalized, TypeError> {
- let val = crate::semantics::tck::typecheck::typecheck(&self.0)?
- .normalize_whnf_noenv();
- Ok(Normalized(val))
- }
}
impl Typed {
diff --git a/dhall/src/semantics/phase/resolve.rs b/dhall/src/semantics/phase/resolve.rs
index 64106aa..cc4a024 100644
--- a/dhall/src/semantics/phase/resolve.rs
+++ b/dhall/src/semantics/phase/resolve.rs
@@ -52,14 +52,10 @@ fn load_import(
import_cache: &mut ImportCache,
import_stack: &ImportStack,
) -> Result<Normalized, Error> {
- // Ok(
- // do_resolve_expr(Parsed::parse_file(f)?, import_cache, import_stack)?
- // .typecheck()?
- // .normalize(),
- // )
Ok(
do_resolve_expr(Parsed::parse_file(f)?, import_cache, import_stack)?
- .tck_and_normalize_new_flow()?,
+ .typecheck()?
+ .normalize(),
)
}
diff --git a/dhall/src/semantics/phase/typecheck.rs b/dhall/src/semantics/phase/typecheck.rs
deleted file mode 100644
index 8b13789..0000000
--- a/dhall/src/semantics/phase/typecheck.rs
+++ /dev/null
@@ -1 +0,0 @@
-