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/builtins.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'dhall/src/semantics/builtins.rs') diff --git a/dhall/src/semantics/builtins.rs b/dhall/src/semantics/builtins.rs index 2211579..6dbe878 100644 --- a/dhall/src/semantics/builtins.rs +++ b/dhall/src/semantics/builtins.rs @@ -35,18 +35,13 @@ impl BuiltinClosure { } } - pub fn apply( - &self, - a: Value, - f_ty: Value, - ret_ty: &Value, - ) -> ValueKind { + pub fn apply(&self, a: Value, f_ty: Value, ret_ty: &Value) -> ValueKind { use std::iter::once; let args = self.args.iter().cloned().chain(once(a.clone())).collect(); let types = self.types.iter().cloned().chain(once(f_ty)).collect(); apply_builtin(self.b, args, ret_ty, types, self.env.clone()) } - pub fn ensure_whnf(self, ret_ty: &Value) -> ValueKind { + pub fn ensure_whnf(self, ret_ty: &Value) -> ValueKind { apply_builtin(self.b, self.args, ret_ty, self.types, self.env) } pub fn normalize_mut(&mut self) { @@ -276,13 +271,13 @@ fn apply_builtin( ty: &Value, types: Vec, env: NzEnv, -) -> ValueKind { +) -> ValueKind { use Builtin::*; use ValueKind::*; // Small helper enum enum Ret { - ValueKind(ValueKind), + ValueKind(ValueKind), Value(Value), DoneAsIs, } -- cgit v1.2.3