From bbf8d68b0df3ca8b3b8cb7324169f0049736ed89 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 20 Apr 2019 23:52:09 +0200 Subject: Move TypeInternal to typecheck --- dhall/src/expr.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'dhall/src/expr.rs') diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs index bb1a4e4..03aa966 100644 --- a/dhall/src/expr.rs +++ b/dhall/src/expr.rs @@ -63,6 +63,8 @@ pub struct SimpleType<'a>( ); derive_other_traits!(SimpleType); +pub(crate) use crate::typecheck::TypeInternal; + /// A Dhall expression representing a (possibly higher-kinded) type. /// /// This includes [SimpleType]s but also higher-kinded expressions like @@ -70,14 +72,6 @@ derive_other_traits!(SimpleType); #[derive(Debug, Clone, PartialEq, Eq)] pub struct Type<'a>(pub(crate) TypeInternal<'a>); -#[derive(Debug, Clone, PartialEq, Eq)] -pub(crate) enum TypeInternal<'a> { - Expr(Box>), - Const(dhall_core::Const), - /// The type of `Sort` - SuperType, -} - // Exposed for the macros #[doc(hidden)] impl<'a> From> for SubExpr { @@ -120,12 +114,6 @@ impl<'a> Normalized<'a> { pub(crate) fn unnote<'b>(self) -> Normalized<'b> { Normalized(self.0, self.1, PhantomData) } - pub(crate) fn into_type(self) -> Type<'a> { - Type(match self.0.as_ref() { - ExprF::Const(c) => TypeInternal::Const(*c), - _ => TypeInternal::Expr(Box::new(self)), - }) - } } #[doc(hidden)] -- cgit v1.2.3