[change let floating to work on combinators throughout.
John Meacham <john@repetae.net>**20080229224502] hunk ./E/FreeVars.hs 126
-    freeVars a = freeVars (combBody a) `union` (freeVars $ combRules a)
+    freeVars a = freeVars (tvrType $ combHead a) `union` freeVars (combBody a) `union` (freeVars $ combRules a)
hunk ./E/LetFloat.hs 103
-    let binds = G.scc $  G.newGraph [ (d,bindingFreeVars x y) | d@(x,y) <- programDs prog, x `notElem` fsts epoints ] (tvrIdent . fst . fst) (idSetToList . snd)
-        binds :: Binds
-        epoints :: [(TVr,E)]
-        epoints = [ d | d@(x,_) <- programDs prog, (x `elem` progEntryPoints prog) || forceNoinline x || getProperty prop_INSTANCE x || getProperty prop_SPECIALIZATION x ]
+    let binds = G.scc $  G.newGraph [ (c ,freeVars c) | c <- progCombinators prog, combIdent c  `notElem` map combIdent epoints ] (combIdent . fst) (idSetToList . snd)
+        epoints = [ c | c@Comb { combHead = x } <- progCombinators prog, (x `elem` progEntryPoints prog) || forceNoinline x || getProperty prop_INSTANCE x || getProperty prop_SPECIALIZATION x ]
hunk ./E/LetFloat.hs 106
-        dpoints = (map (\ (x,y) -> bindingFreeVars x y) epoints)
-        nprog = programSetDs ([ (k,fi k v y)| ((k,v),y) <- zip epoints pints] ++ [ (x,floatInwardE y []) | (x,y) <- dsBinds oall]) prog
+        dpoints = map freeVars epoints
+        nprog = progCombinators_s ([ combBody_u (\v -> fi c v y) c | (c,y) <- zip epoints pints] ++ [ combBody_u (\y -> floatInwardE y []) c | c <- dsBinds oall]) prog
hunk ./E/LetFloat.hs 114
-    let mstats = mconcat [ Stats.singleton $ "FloatInward.{" ++ pprint n ++ "}" | n <- map fst $ dsBinds (concat pints)]
-        mstats' = mconcat [ Stats.singleton $ "FloatInward.all.{" ++ pprint n ++ "}" | n <- map fst $ dsBinds oall]
+    let mstats = mconcat [ Stats.singleton $ "FloatInward.{" ++ pprint n ++ "}" | n <- map combHead $ dsBinds (concat pints)]
+        mstats' = mconcat [ Stats.singleton $ "FloatInward.all.{" ++ pprint n ++ "}" | n <- map combHead $ dsBinds oall]
hunk ./E/LetFloat.hs 131
+floatInwardE :: E -> Binds -> E
hunk ./E/LetFloat.hs 136
-    f ELetRec { eDefs = ds, eBody = e } xs = g (G.scc $  G.newGraph [ (d,bindingFreeVars x y) | d@(x,y) <- ds ] (tvrIdent . fst . fst) (idSetToList . snd) ) xs where
+    f ELetRec { eDefs = ds, eBody = e } xs = g (G.scc $  G.newGraph [ (bindComb d,freeVars $ bindComb d) | d <- ds ] (combIdent . fst) (idSetToList . snd) ) xs where
hunk ./E/LetFloat.hs 138
-        g ((Left ((v,ev),fv)):xs) p = g xs (p0 ++ [Left ((v,ev'),bindingFreeVars v ev')] ++ p') where
+        g ((Left (comb@Comb { combHead = v, combBody = ev},fv)):xs) p = g xs (p0 ++ [Left (comb',freeVars comb')] ++ p') where
+            comb' = combBody_s ev' comb
hunk ./E/LetFloat.hs 142
-        g (Right bs:xs) p =  g xs (p0 ++ [Right [ let ev' = f ev pv in ((v,ev'),bindingFreeVars v ev') | ((v,ev),_) <- bs | pv <- ps ]] ++ p') where
-            (p',_:p0:ps) = sepByDropPoint (freeVars (map (tvrType . fst . fst) bs) :(frest xs):snds bs) p
+        g (Right bs:xs) p =  g xs (p0 ++ [Right [ let comb' = combBody_u (\ev -> f ev pv) comb in (comb',freeVars comb') | (comb,_) <- bs | pv <- ps ]] ++ p') where
+            (p',_:p0:ps) = sepByDropPoint (freeVars (map (tvrType . combHead . fst) bs) :(frest xs):snds bs) p
hunk ./E/LetFloat.hs 150
-    f e (Left ((v',ev),_):xs)
-        | (EVar v,as) <- fromAp e, v == v', not (tvrIdent v' `member` (freeVars as :: IdSet))  = f (runIdentity $ app (ev,as) {- foldl EAp ev as -} ) xs
+    f e (Left (Comb { combHead = v', combBody = ev},_):xs)
+        | (EVar v,as) <- fromAp e, v == v', not (tvrIdent v' `member` (freeVars as :: IdSet))  = f (runIdentity $ app (ev,as)) xs
hunk ./E/LetFloat.hs 154
-    letRec xs e = f (G.scc $ G.newGraph (concatMap G.fromScc xs) (tvrIdent . fst . fst) (idSetToList . snd)) where
+    letRec xs e = f (G.scc $ G.newGraph (concatMap G.fromScc xs) (combIdent . fst) (idSetToList . snd)) where
hunk ./E/LetFloat.hs 156
-        f (Left (te,_):rs) = eLetRec [te] $ f rs
-        f (Right ds:rs) = eLetRec (fsts ds) $ f rs
+        f (Left (te,_):rs) = eLetRec [combBind te] $ f rs
+        f (Right ds:rs) = eLetRec (map (combBind . fst) ds) $ f rs
hunk ./E/LetFloat.hs 164
-type Binds = [Either ((TVr,E),FVarSet) [((TVr,E),FVarSet)]]
+type Binds = [Either (Comb,FVarSet) [(Comb,FVarSet)]]
hunk ./E/LetFloat.hs 172
-    g = G.reachable (G.newGraph (concatMap G.fromScc xs) (tvrIdent . fst . fst) (idSetToList . snd)) (fvs `mappend` unsafe_ones)
-    uso = map (tvrIdent . fst . fst) g
-    unsafe_ones = concat [ map (tvrIdent . fst . fst) vs | vs <- map G.fromScc xs,any (not . isCheap) (map (snd . fst) vs)]
-    ind x = any ( (`elem` uso) . tvrIdent . fst . fst ) (G.fromScc x)
+    g = G.reachable (G.newGraph (concatMap G.fromScc xs) (combIdent . fst) (idSetToList . snd)) (fvs `mappend` unsafe_ones)
+    uso = map (combIdent . fst) g
+    unsafe_ones = concat [ map (combIdent . fst) vs | vs <- map G.fromScc xs,any (not . isCheap) (map (combBody . fst) vs)]
+    ind x = any ( (`elem` uso) . combIdent . fst ) (G.fromScc x)
hunk ./E/LetFloat.hs 201
-    fvDecls (Left ((t,_),_)) = [tvrIdent t]
-    fvDecls (Right ts) = [tvrIdent t | ((t,_),_) <- ts ]
+    fvDecls (Left (c,_)) = [combIdent c]
+    fvDecls (Right ts) = [combIdent c | (c,_) <- ts ]