summaryrefslogtreecommitdiff
path: root/dhall/src/typecheck.rs
diff options
context:
space:
mode:
authorNadrieril2019-04-08 17:56:35 +0200
committerNadrieril2019-04-08 17:56:35 +0200
commit00fa24b851ff6337cf4c5c63f82d95488180a413 (patch)
tree5bd21c934233622b86520743d7a9d3cb6203a1a4 /dhall/src/typecheck.rs
parentb6bd26f08866d4025ca98faf3a3e5f15353aacbf (diff)
Limit public API
Closes #53
Diffstat (limited to 'dhall/src/typecheck.rs')
-rw-r--r--dhall/src/typecheck.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs
index ba32408..5230aab 100644
--- a/dhall/src/typecheck.rs
+++ b/dhall/src/typecheck.rs
@@ -11,7 +11,7 @@ use self::TypeMessage::*;
impl Resolved {
pub fn typecheck(self) -> Result<Typed, TypeError<X>> {
- type_of_(self.0.clone())
+ type_of(self.0.clone())
}
/// Pretends this expression has been typechecked. Use with care.
pub fn skip_typecheck(self) -> Typed {
@@ -604,12 +604,7 @@ pub fn type_with(
/// `typeOf` is the same as `type_with` with an empty context, meaning that the
/// expression must be closed (i.e. no free variables), otherwise type-checking
/// will fail.
-pub fn type_of(e: SubExpr<X, X>) -> Result<SubExpr<X, X>, TypeError<X>> {
- let e = type_of_(e)?;
- Ok(e.get_type_move().into_normalized()?.into_expr())
-}
-
-pub fn type_of_(e: SubExpr<X, X>) -> Result<Typed, TypeError<X>> {
+pub fn type_of(e: SubExpr<X, X>) -> Result<Typed, TypeError<X>> {
let ctx = Context::new();
let e = type_with(&ctx, e)?;
// Ensure the inferred type isn't UNTYPE