diff options
Diffstat (limited to 'dhall/src/phase/typecheck.rs')
-rw-r--r-- | dhall/src/phase/typecheck.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dhall/src/phase/typecheck.rs b/dhall/src/phase/typecheck.rs index 5eab8da..56fb5ed 100644 --- a/dhall/src/phase/typecheck.rs +++ b/dhall/src/phase/typecheck.rs @@ -147,7 +147,7 @@ fn function_check(a: Const, b: Const) -> Const { } } -pub fn type_of_const(c: Const) -> Result<Type, TypeError> { +pub(crate) fn type_of_const(c: Const) -> Result<Type, TypeError> { match c { Const::Type => Ok(Type::from_const(Const::Kind)), Const::Kind => Ok(Type::from_const(Const::Sort)), @@ -300,14 +300,14 @@ fn type_of_builtin<E>(b: Builtin) -> Expr<E> { /// Takes an expression that is meant to contain a Type /// and turn it into a type, typechecking it along the way. -pub fn mktype( +pub(crate) fn mktype( ctx: &TypecheckContext, e: SubExpr<Normalized>, ) -> Result<Type, TypeError> { Ok(type_with(ctx, e)?.to_type()) } -pub fn builtin_to_type(b: Builtin) -> Result<Type, TypeError> { +pub(crate) fn builtin_to_type(b: Builtin) -> Result<Type, TypeError> { mktype(&TypecheckContext::new(), SubExpr::from_builtin(b)) } @@ -1009,15 +1009,15 @@ fn type_of(e: SubExpr<Normalized>) -> Result<Typed, TypeError> { Ok(e) } -pub fn typecheck(e: Resolved) -> Result<Typed, TypeError> { +pub(crate) fn typecheck(e: Resolved) -> Result<Typed, TypeError> { type_of(e.0) } -pub fn typecheck_with(e: Resolved, ty: &Type) -> Result<Typed, TypeError> { +pub(crate) fn typecheck_with(e: Resolved, ty: &Type) -> Result<Typed, TypeError> { let expr: SubExpr<_> = e.0; let ty: SubExpr<_> = ty.to_expr(); type_of(expr.rewrap(ExprF::Annot(expr.clone(), ty))) } -pub fn skip_typecheck(e: Resolved) -> Typed { +pub(crate) fn skip_typecheck(e: Resolved) -> Typed { Typed::from_thunk_untyped(Thunk::new(NormalizationContext::new(), e.0)) } |