From 69b65ee70a84b591c9a56861317253577e7c7628 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 29 Apr 2019 22:01:25 +0200 Subject: Make NF and WHNF custom types instead of aliases --- dhall/src/normalize.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'dhall/src') diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs index 43e7292..d58ea7a 100644 --- a/dhall/src/normalize.rs +++ b/dhall/src/normalize.rs @@ -355,8 +355,10 @@ impl NormalizationContext { } } -pub(crate) type WHNF = (); -pub(crate) type NF = X; +#[derive(Debug, Clone)] +pub(crate) struct WHNF; +#[derive(Debug, Clone)] +pub(crate) enum NF {} /// A semantic value. `Form` should be either `WHNF` or `NF`. /// `NF` stands for Normal Form and indicates that all subexpressions are normalized. @@ -851,7 +853,7 @@ pub(crate) enum Thunk
{ impl Thunk { fn new(ctx: NormalizationContext, e: InputSubExpr) -> Thunk { - Thunk::Unnormalized((), ctx, e) + Thunk::Unnormalized(WHNF, ctx, e) } fn from_whnf(v: Value) -> Thunk { -- cgit v1.2.3