From 33c1aa4bd1d5b83361eb52d00beb8d8c762225cd Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 9 May 2019 23:18:55 +0200 Subject: Make visibilities more consistent --- dhall/src/phase/typecheck.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'dhall/src/phase/typecheck.rs') diff --git a/dhall/src/phase/typecheck.rs b/dhall/src/phase/typecheck.rs index 7f988c8..c2d9da3 100644 --- a/dhall/src/phase/typecheck.rs +++ b/dhall/src/phase/typecheck.rs @@ -218,7 +218,7 @@ where eL0.borrow().to_value() == eR0.borrow().to_value() } -pub(crate) fn type_of_const(c: Const) -> Result { +pub fn type_of_const(c: Const) -> Result { match c { Const::Type => Ok(Type::from_const(Const::Kind)), Const::Kind => Ok(Type::from_const(Const::Sort)), @@ -317,14 +317,14 @@ fn type_of_builtin(b: Builtin) -> Expr { /// Takes an expression that is meant to contain a Type /// and turn it into a type, typechecking it along the way. -pub(crate) fn mktype( +pub fn mktype( ctx: &TypecheckContext, e: SubExpr, ) -> Result { Ok(type_with(ctx, e)?.to_type()) } -pub(crate) fn builtin_to_type(b: Builtin) -> Result { +pub fn builtin_to_type(b: Builtin) -> Result { mktype(&TypecheckContext::new(), SubExpr::from_builtin(b)) } @@ -777,19 +777,16 @@ fn type_of(e: SubExpr) -> Result { Ok(e) } -pub(crate) fn typecheck(e: Resolved) -> Result { +pub fn typecheck(e: Resolved) -> Result { type_of(e.0) } -pub(crate) fn typecheck_with( - e: Resolved, - ty: &Type, -) -> Result { +pub fn typecheck_with(e: Resolved, ty: &Type) -> Result { let expr: SubExpr<_, _> = e.0; let ty: SubExpr<_, _> = ty.to_expr().absurd(); type_of(expr.rewrap(ExprF::Annot(expr.clone(), ty))) } -pub(crate) fn skip_typecheck(e: Resolved) -> Typed { +pub fn skip_typecheck(e: Resolved) -> Typed { Typed::from_thunk_untyped(Thunk::new(NormalizationContext::new(), e.0)) } -- cgit v1.2.3