From 6bb8e618f66df4a955d800d49b3b6863aabd5b41 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 29 Apr 2019 23:28:16 +0200 Subject: Remove NF/WHNF distinction at runtime --- dhall/src/expr.rs | 2 +- dhall/src/normalize.rs | 165 +++++++++++++++++++++---------------------------- dhall/src/typecheck.rs | 12 ++-- 3 files changed, 79 insertions(+), 100 deletions(-) diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs index e7beafa..b2f2bec 100644 --- a/dhall/src/expr.rs +++ b/dhall/src/expr.rs @@ -47,7 +47,7 @@ derive_other_traits!(Typed); #[derive(Debug, Clone)] pub(crate) struct PartiallyNormalized<'a>( - pub(crate) crate::normalize::Value, + pub(crate) crate::normalize::Value, pub(crate) Option>, pub(crate) PhantomData<&'a ()>, ); diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs index d58ea7a..3b21b86 100644 --- a/dhall/src/normalize.rs +++ b/dhall/src/normalize.rs @@ -70,12 +70,12 @@ impl<'a> PartiallyNormalized<'a> { self.2, ) } - pub(crate) fn into_whnf(self) -> Value { + pub(crate) fn into_whnf(self) -> Value { self.0 } } -fn apply_builtin(b: Builtin, args: Vec>) -> Value { +fn apply_builtin(b: Builtin, args: Vec) -> Value { use dhall_core::Builtin::*; use Value::*; @@ -264,7 +264,7 @@ fn apply_builtin(b: Builtin, args: Vec>) -> Value { #[derive(Debug, Clone)] enum EnvItem { - Expr(Value), + Expr(Value), Skip(V