summaryrefslogtreecommitdiff
path: root/dhall/src/expr.rs
diff options
context:
space:
mode:
authorNadrieril2019-04-21 11:30:58 +0200
committerNadrieril2019-04-21 11:30:58 +0200
commitd1f828961bccf9627ef4fb76ca528f039d180ff7 (patch)
treef5dc49a621138b98c69537b850118c20107bcd7d /dhall/src/expr.rs
parentbbf8d68b0df3ca8b3b8cb7324169f0049736ed89 (diff)
Embrace TypeInternal as a semantic value
Diffstat (limited to '')
-rw-r--r--dhall/src/expr.rs9
1 files changed, 9 insertions, 0 deletions
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<SimpleType<'a>> for SubExpr<X, X> {