summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/resolve/hir.rs
diff options
context:
space:
mode:
authorNadrieril2020-03-13 17:04:47 +0000
committerNadrieril2020-03-31 21:44:01 +0100
commit35db1b4b54dba8b0cafe661329e0099dfabd8073 (patch)
tree8b98ed443c5acb88841ccda355e7f24cb9c56515 /dhall/src/semantics/resolve/hir.rs
parent2f5c45fd2f712f7befe6f7c92b62dc76d5f77538 (diff)
Remove top-level Expr aliases
Diffstat (limited to 'dhall/src/semantics/resolve/hir.rs')
-rw-r--r--dhall/src/semantics/resolve/hir.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/dhall/src/semantics/resolve/hir.rs b/dhall/src/semantics/resolve/hir.rs
index fa2989f..22abaaf 100644
--- a/dhall/src/semantics/resolve/hir.rs
+++ b/dhall/src/semantics/resolve/hir.rs
@@ -1,7 +1,7 @@
use crate::error::TypeError;
use crate::semantics::{type_with, NameEnv, Nir, NzEnv, Tir, TyEnv, Type};
use crate::syntax::{Expr, ExprKind, Span, V};
-use crate::{NormalizedExpr, ToExprOptions};
+use crate::ToExprOptions;
/// Stores an alpha-normalized variable.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
@@ -51,15 +51,15 @@ impl Hir {
}
/// Converts a closed Hir expr back to the corresponding AST expression.
- pub fn to_expr(&self, opts: ToExprOptions) -> NormalizedExpr {
+ pub fn to_expr(&self, opts: ToExprOptions) -> Expr {
hir_to_expr(self, opts, &mut NameEnv::new())
}
/// Converts a closed Hir expr back to the corresponding AST expression.
- pub fn to_expr_noopts(&self) -> NormalizedExpr {
+ pub fn to_expr_noopts(&self) -> Expr {
let opts = ToExprOptions { alpha: false };
self.to_expr(opts)
}
- pub fn to_expr_tyenv(&self, env: &TyEnv) -> NormalizedExpr {
+ pub fn to_expr_tyenv(&self, env: &TyEnv) -> Expr {
let opts = ToExprOptions { alpha: false };
let mut env = env.as_nameenv().clone();
hir_to_expr(self, opts, &mut env)
@@ -93,11 +93,7 @@ impl Hir {
}
}
-fn hir_to_expr(
- hir: &Hir,
- opts: ToExprOptions,
- env: &mut NameEnv,
-) -> NormalizedExpr {
+fn hir_to_expr(hir: &Hir, opts: ToExprOptions, env: &mut NameEnv) -> Expr {
let kind = match hir.kind() {
HirKind::Var(v) if opts.alpha => ExprKind::Var(V("_".into(), v.idx())),
HirKind::Var(v) => ExprKind::Var(env.label_var(*v)),