diff options
Diffstat (limited to 'dhall/src/core/value.rs')
-rw-r--r-- | dhall/src/core/value.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs index 87816c4..0af7c8c 100644 --- a/dhall/src/core/value.rs +++ b/dhall/src/core/value.rs @@ -40,8 +40,7 @@ struct ValueInternal { /// Stores a possibly unevaluated value. Gets (partially) normalized on-demand, /// sharing computation automatically. Uses a RefCell to share computation. -/// Can optionally store a type from typechecking to preserve type information through -/// normalization. +/// Can optionally store a type from typechecking to preserve type information. #[derive(Clone)] pub struct Value(Rc<RefCell<ValueInternal>>); @@ -160,10 +159,6 @@ impl Value { pub(crate) fn to_expr_alpha(&self) -> NormalizedSubExpr { self.as_whnf().normalize_to_expr_maybe_alpha(true) } - // TODO: deprecated - pub(crate) fn to_value(&self) -> Value { - self.clone() - } /// TODO: cloning a valuef can often be avoided pub(crate) fn to_whnf(&self) -> ValueF { self.as_whnf().clone() @@ -172,8 +167,7 @@ impl Value { Typed::from_value(self) } - /// Mutates the contents. If no one else shares this thunk, - /// mutates directly, thus avoiding a RefCell lock. + /// Mutates the contents. If no one else shares this, this avoids a RefCell lock. fn mutate_internal(&mut self, f: impl FnOnce(&mut ValueInternal)) { match Rc::get_mut(&mut self.0) { // Mutate directly if sole owner @@ -183,7 +177,7 @@ impl Value { } } /// Normalizes contents to normal form; faster than `normalize_nf` if - /// no one else shares this thunk. + /// no one else shares this. pub(crate) fn normalize_mut(&mut self) { self.mutate_internal(|vint| vint.normalize_nf()) } @@ -218,10 +212,6 @@ impl Value { self.as_nf().normalize_to_expr_maybe_alpha(alpha) } - pub(crate) fn app_valuef(&self, val: ValueF) -> ValueF { - self.app_value(val.into_value_untyped()) - } - pub(crate) fn app_value(&self, th: Value) -> ValueF { apply_any(self.clone(), th) } |