summaryrefslogtreecommitdiff
path: root/dhall/src/core/value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/core/value.rs')
-rw-r--r--dhall/src/core/value.rs19
1 files changed, 6 insertions, 13 deletions
diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs
index 19be56a..61a8eea 100644
--- a/dhall/src/core/value.rs
+++ b/dhall/src/core/value.rs
@@ -56,17 +56,17 @@ pub enum Value {
}
impl Value {
- pub fn into_thunk(self) -> Thunk {
+ pub(crate) fn into_thunk(self) -> Thunk {
Thunk::from_value(self)
}
/// Convert the value to a fully normalized syntactic expression
- pub fn normalize_to_expr(&self) -> OutputSubExpr {
+ pub(crate) fn normalize_to_expr(&self) -> OutputSubExpr {
self.normalize_to_expr_maybe_alpha(false)
}
/// Convert the value to a fully normalized syntactic expression. Also alpha-normalize
/// if alpha is `true`
- pub fn normalize_to_expr_maybe_alpha(&self, alpha: bool) -> OutputSubExpr {
+ pub(crate) fn normalize_to_expr_maybe_alpha(&self, alpha: bool) -> OutputSubExpr {
match self {
Value::Lam(x, t, e) => rc(ExprF::Lam(
x.to_label_maybe_alpha(alpha),
@@ -179,14 +179,7 @@ impl Value {
}
}
- // Deprecated
- pub fn normalize(&self) -> Value {
- let mut v = self.clone();
- v.normalize_mut();
- v
- }
-
- pub fn normalize_mut(&mut self) {
+ pub(crate) fn normalize_mut(&mut self) {
match self {
Value::Var(_)
| Value::Const(_)
@@ -264,12 +257,12 @@ impl Value {
}
/// Apply to a value
- pub fn app(self, val: Value) -> Value {
+ pub(crate) fn app(self, val: Value) -> Value {
self.app_val(val)
}
/// Apply to a value
- pub fn app_val(self, val: Value) -> Value {
+ pub(crate) fn app_val(self, val: Value) -> Value {
self.app_thunk(val.into_thunk())
}