#![allow(non_snake_case)] use std::collections::BTreeMap; use std::rc::Rc; use dhall_core::context::Context; use dhall_core::{ rc, Builtin, Const, ExprF, Integer, InterpolatedText, InterpolatedTextContents, Label, Natural, SubExpr, V, X, }; use dhall_generator as dhall; use crate::expr::{Normalized, Type, Typed}; type InputSubExpr = SubExpr>; type OutputSubExpr = SubExpr; impl<'a> Typed<'a> { /// Reduce an expression to its normal form, performing beta reduction /// /// `normalize` does not type-check the expression. You may want to type-check /// expressions before normalizing them since normalization can convert an /// ill-typed expression into a well-typed expression. /// /// However, `normalize` will not fail if the expression is ill-typed and will /// leave ill-typed sub-expressions unevaluated. /// pub fn normalize(self) -> Normalized<'a> { Normalized(self.0.normalize_whnf().normalize_to_expr(), self.1, self.2) } pub(crate) fn shift(&self, delta: isize, var: &V