From 0749482ad2ab9340fb45a2fe2997d2ea04516d75 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 30 Jan 2020 18:06:53 +0000 Subject: Remove type parameter from ValueKind --- dhall/src/semantics/nze/normalize.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'dhall/src/semantics/nze/normalize.rs') diff --git a/dhall/src/semantics/nze/normalize.rs b/dhall/src/semantics/nze/normalize.rs index 6564018..90036e3 100644 --- a/dhall/src/semantics/nze/normalize.rs +++ b/dhall/src/semantics/nze/normalize.rs @@ -9,7 +9,7 @@ use crate::syntax::{ }; use crate::Normalized; -pub(crate) fn apply_any(f: Value, a: Value, ty: &Value) -> ValueKind { +pub(crate) fn apply_any(f: Value, a: Value, ty: &Value) -> ValueKind { let f_borrow = f.kind(); match &*f_borrow { ValueKind::LamClosure { closure, .. } => { @@ -102,7 +102,7 @@ where // Small helper enum to avoid repetition enum Ret<'a> { - ValueKind(ValueKind), + ValueKind(ValueKind), Value(Value), ValueRef(&'a Value), Expr(ExprKind), @@ -255,7 +255,7 @@ pub(crate) fn normalize_one_layer( expr: ExprKind, ty: &Value, env: &NzEnv, -) -> ValueKind { +) -> ValueKind { use ValueKind::{ BoolLit, DoubleLit, EmptyOptionalLit, IntegerLit, NEListLit, NEOptionalLit, NaturalLit, RecordLit, RecordType, TextLit, @@ -450,10 +450,7 @@ pub(crate) fn normalize_one_layer( } /// Normalize a ValueKind into WHNF -pub(crate) fn normalize_whnf( - v: ValueKind, - ty: &Value, -) -> ValueKind { +pub(crate) fn normalize_whnf(v: ValueKind, ty: &Value) -> ValueKind { match v { ValueKind::AppliedBuiltin(closure) => closure.ensure_whnf(ty), ValueKind::PartialExpr(e) => normalize_one_layer(e, ty, &NzEnv::new()), -- cgit v1.2.3