#![allow(non_snake_case)] use std::fmt; use crate::expr::*; use dhall_core; use dhall_core::context::Context; use dhall_core::*; use dhall_generator as dhall; use std::borrow::Cow; use self::TypeMessage::*; impl Resolved { pub fn typecheck(self) -> Result> { let typ = crate::typecheck::type_of_(self.0.clone())?; Ok(typ) } } impl Typed { #[inline(always)] fn as_expr(&self) -> &SubExpr { &self.0 } #[inline(always)] fn into_expr(self) -> SubExpr { self.0 } #[inline(always)] pub fn get_type<'a>(&'a self) -> Type<'a> { self.1.reborrow() } } impl Normalized { #[inline(always)] fn as_expr(&self) -> &SubExpr { &self.0 } #[inline(always)] fn into_expr(self) -> SubExpr { self.0 } #[inline(always)] pub fn get_type<'a>(&'a self) -> Type<'a> { self.1.reborrow() } #[inline(always)] fn into_type(self) -> Type<'static> { crate::expr::Type(Cow::Owned(TypeInternal::Expr(Box::new(self)))) } // Expose the outermost constructor #[inline(always)] fn unroll_ref(&self) -> &Expr { self.as_expr().as_ref() } #[inline(always)] fn shift(&self, delta: isize, var: &V