summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2019-04-29 22:01:25 +0200
committerNadrieril2019-04-29 22:01:25 +0200
commit69b65ee70a84b591c9a56861317253577e7c7628 (patch)
tree75ae87df1982cbf2a9f80b283644ab22b60d486c
parent439947345ef52ce04a66b1d4fa9c05d2b6964fa1 (diff)
Make NF and WHNF custom types instead of aliases
-rw-r--r--dhall/src/normalize.rs8
1 files changed, 5 insertions, 3 deletions
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<Form> {
impl Thunk<WHNF> {
fn new(ctx: NormalizationContext, e: InputSubExpr) -> Thunk<WHNF> {
- Thunk::Unnormalized((), ctx, e)
+ Thunk::Unnormalized(WHNF, ctx, e)
}
fn from_whnf(v: Value<WHNF>) -> Thunk<WHNF> {