[project @ 1999-03-17 11:03:36 by simonm]
authorsimonm <unknown>
Wed, 17 Mar 1999 11:03:36 +0000 (11:03 +0000)
committersimonm <unknown>
Wed, 17 Mar 1999 11:03:36 +0000 (11:03 +0000)
Ignore type lambdas for the purposes of occurrence analysis.

ghc/compiler/simplCore/OccurAnal.lhs

index 9bb19b9..5b021f0 100644 (file)
@@ -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...)