From: simonpj@microsoft.com Date: Tue, 17 Nov 2009 12:55:26 +0000 (+0000) Subject: exprIsHNF should "look through" lets X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=69570e0b00cd839a42e8875830b99417580c6245 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. --- 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