From 69570e0b00cd839a42e8875830b99417580c6245 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Tue, 17 Nov 2009 12:55:26 +0000 Subject: [PATCH] exprIsHNF should "look through" lets I can't quite remember when I spotted this, but exprIsHNF (and similarly exprIsConLike) should ignore enclosing let-bindings, since they don't affect termination. --- compiler/coreSyn/CoreUtils.lhs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs index 58beaf0..d200f81 100644 --- a/compiler/coreSyn/CoreUtils.lhs +++ b/compiler/coreSyn/CoreUtils.lhs @@ -736,6 +736,7 @@ exprIsHNFlike is_con is_con_unf = is_hnf_like is_hnf_like (Cast e _) = is_hnf_like e is_hnf_like (App e (Type _)) = is_hnf_like e is_hnf_like (App e a) = app_is_value e [a] + is_hnf_like (Let _ e) = is_hnf_like e -- Lazy let(rec)s don't affect us is_hnf_like _ = False -- There is at least one value argument -- 1.7.10.4