summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/core/value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/semantics/core/value.rs')
-rw-r--r--dhall/src/semantics/core/value.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/dhall/src/semantics/core/value.rs b/dhall/src/semantics/core/value.rs
index 9b64bd2..f8146f5 100644
--- a/dhall/src/semantics/core/value.rs
+++ b/dhall/src/semantics/core/value.rs
@@ -306,14 +306,6 @@ impl ValueKind<Value> {
Value::from_kind_and_type(self, t)
}
- /// Converts a value back to the corresponding AST expression.
- pub(crate) fn to_expr(
- &self,
- opts: to_expr::ToExprOptions,
- ) -> NormalizedExpr {
- to_expr::kind_to_expr(self, opts)
- }
-
pub(crate) fn normalize_mut(&mut self) {
match self {
ValueKind::Var(_)
@@ -390,7 +382,6 @@ impl ValueKind<Value> {
}
impl<V> ValueKind<V> {
- #[allow(dead_code)]
pub(crate) fn map_ref_with_special_handling_of_binders<'a, V2>(
&'a self,
mut map_val: impl FnMut(&'a V) -> V2,
@@ -407,6 +398,15 @@ impl<V> ValueKind<V> {
.visit(self),
)
}
+
+ pub(crate) fn map_ref<'a, V2>(
+ &'a self,
+ map_val: impl Fn(&'a V) -> V2,
+ ) -> ValueKind<V2> {
+ self.map_ref_with_special_handling_of_binders(&map_val, |_, x| {
+ map_val(x)
+ })
+ }
}
/// Compare two values for equality modulo alpha/beta-equivalence.