From e28f99fd4328e0fd4522296fa71a33caec510ee6 Mon Sep 17 00:00:00 2001 From: simonm Date: Wed, 17 Mar 1999 11:03:36 +0000 Subject: [PATCH] [project @ 1999-03-17 11:03:36 by simonm] Ignore type lambdas for the purposes of occurrence analysis. --- ghc/compiler/simplCore/OccurAnal.lhs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ghc/compiler/simplCore/OccurAnal.lhs b/ghc/compiler/simplCore/OccurAnal.lhs index 9bb19b9..5b021f0 100644 --- a/ghc/compiler/simplCore/OccurAnal.lhs +++ b/ghc/compiler/simplCore/OccurAnal.lhs @@ -631,6 +631,14 @@ occAnal env (App fun arg) (fun_usage `combineUsageDetails` mapVarEnv markLazy arg_usage, App fun' arg') }} +-- Ignore type variables altogether +-- (a) occurrences inside type lambdas only not marked as InsideLam +-- (b) type variables not in environment + +occAnal env expr@(Lam x body) | isTyVar x + = case occAnal env body of { (body_usage, body') -> + (body_usage, Lam x body') + } -- For value lambdas we do a special hack. Consider -- (\x. \y. ...x...) -- 1.7.10.4