summaryrefslogtreecommitdiff
path: root/dhall/src/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/expr.rs')
-rw-r--r--dhall/src/expr.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs
index 9e89e3a..7c62a33 100644
--- a/dhall/src/expr.rs
+++ b/dhall/src/expr.rs
@@ -120,6 +120,9 @@ impl<'a> Normalized<'a> {
pub(crate) fn into_expr(self) -> SubExpr<X, X> {
self.0
}
+ 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),
@@ -128,6 +131,18 @@ impl<'a> Normalized<'a> {
}
}
+#[doc(hidden)]
+impl<'a> Type<'a> {
+ pub(crate) fn unnote<'b>(self) -> Type<'b> {
+ use TypeInternal::*;
+ Type(match self.0 {
+ Expr(e) => Expr(Box::new(e.unnote())),
+ Const(c) => Const(c),
+ SuperType => SuperType,
+ })
+ }
+}
+
impl<'a> SimpleType<'a> {
pub(crate) fn into_type(self) -> Type<'a> {
Normalized(self.0, Some(Type::const_type()), PhantomData).into_type()