diff options
author | Nadrieril | 2020-03-13 21:29:08 +0000 |
---|---|---|
committer | Nadrieril | 2020-03-31 21:44:01 +0100 |
commit | f4a1a6b8d4de5f83649b2ddd90d65f6e6d76e5e1 (patch) | |
tree | 4430f8e81cc8d451ed16c8b45d6f2ce8ed2f8c56 /dhall/src/lib.rs | |
parent | ef3734a3e9381b2e91552089774126f58f560bc3 (diff) |
Nir::normalize isn't useful
It pretends to normalize but actually can't normalize under lambdas. The
correct way to normalize a Nir is to convert it to Hir.
Diffstat (limited to '')
-rw-r--r-- | dhall/src/lib.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index 07df2b2..caaf260 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -42,6 +42,8 @@ pub(crate) struct Typed { } /// A normalized expression. +/// +/// This is actually a lie, because the expression will only get normalized on demand. #[derive(Debug, Clone)] pub(crate) struct Normalized(Nir); @@ -112,7 +114,7 @@ impl Typed { } /// Reduce an expression to its normal form, performing beta reduction pub fn normalize(&self) -> Normalized { - Normalized(self.hir.rec_eval_closed_expr()) + Normalized(self.hir.eval_closed_expr()) } /// Converts a value back to the corresponding AST expression. |