diff options
author | Nadrieril | 2020-01-30 14:20:01 +0000 |
---|---|---|
committer | Nadrieril | 2020-01-30 14:20:01 +0000 |
commit | cb86493012b268ec32ad85a42b54fb1a2adab7b0 (patch) | |
tree | f178e67a5196c2d430bb0a7431f1b7b044883c46 /dhall/src/semantics/core | |
parent | da55a72717b247444a31b1932f85ce4abec03c14 (diff) |
s/as_whnf/kind/
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/core/value.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dhall/src/semantics/core/value.rs b/dhall/src/semantics/core/value.rs index e69d220..02c8013 100644 --- a/dhall/src/semantics/core/value.rs +++ b/dhall/src/semantics/core/value.rs @@ -157,7 +157,7 @@ impl Value { } pub(crate) fn as_const(&self) -> Option<Const> { - match &*self.as_whnf() { + match &*self.kind() { ValueKind::Const(c) => Some(*c), _ => None, } @@ -180,7 +180,7 @@ impl Value { /// This is what you want if you want to pattern-match on the value. /// WARNING: drop this ref before normalizing the same value or you will run into BorrowMut /// panics. - pub(crate) fn as_whnf(&self) -> Ref<ValueKind<Value>> { + pub(crate) fn kind(&self) -> Ref<ValueKind<Value>> { self.normalize_whnf(); self.as_kind() } @@ -194,7 +194,7 @@ impl Value { self.to_tyexpr_noenv().to_expr(opts) } pub(crate) fn to_whnf_ignore_type(&self) -> ValueKind<Value> { - self.as_whnf().clone() + self.kind().clone() } /// Before discarding type information, check that it matches the expected return type. pub(crate) fn to_whnf_check_type(&self, ty: &Value) -> ValueKind<Value> { @@ -233,7 +233,7 @@ impl Value { } pub(crate) fn app(&self, v: Value) -> Value { - let body_t = match &*self.get_type_not_sort().as_whnf() { + let body_t = match &*self.get_type_not_sort().kind() { ValueKind::PiClosure { annot, closure, .. } => { v.check_type(annot); closure.apply(v.clone()) @@ -617,7 +617,7 @@ impl Closure { // TODO: use Rc comparison to shortcut on identical pointers impl std::cmp::PartialEq for Value { fn eq(&self, other: &Self) -> bool { - *self.as_whnf() == *other.as_whnf() + *self.kind() == *other.kind() } } impl std::cmp::Eq for Value {} |