From d1f828961bccf9627ef4fb76ca528f039d180ff7 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 21 Apr 2019 11:30:58 +0200 Subject: Embrace TypeInternal as a semantic value --- dhall/src/expr.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dhall/src/expr.rs') diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs index 03aa966..44d1612 100644 --- a/dhall/src/expr.rs +++ b/dhall/src/expr.rs @@ -72,6 +72,15 @@ pub(crate) use crate::typecheck::TypeInternal; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Type<'a>(pub(crate) TypeInternal<'a>); +impl<'a> std::fmt::Display for Type<'a> { + fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { + match self.0.clone().into_normalized() { + Ok(e) => e.fmt(f), + Err(_) => write!(f, "SuperType"), + } + } +} + // Exposed for the macros #[doc(hidden)] impl<'a> From> for SubExpr { -- cgit v1.2.3