[add solveDs entry point, when function is partially applied, propegate lazified usage info. demote argumets to L on construction.
John Meacham <john@repetae.net>**20060718053319] hunk ./E/Demand.hs 7
+    solveDs,
hunk ./E/Demand.hs 105
+sp xs = S (Product xs) -- None
+
+l None = L None
+l (Product xs) = lp xs
+
+lp [] = L None
+lp xs = L (Product (map f xs)) where
+    f (S None) = lazy
+    f (S (Product ys)) = lp ys
+    f Bottom = Absent
+    f (Error None) = lazy
+    f (Error (Product xs)) = lp xs
+    f x = x
+
+{-
hunk ./E/Demand.hs 126
+-}
hunk ./E/Demand.hs 147
-    lub (S x) Absent = L x
-    lub Absent (S x) = L x
+    lub (S x) Absent = l x
+    lub Absent (S x) = l x
hunk ./E/Demand.hs 153
-    lub (L x) (L y) = L (comb lub x y)
+    lub (L x) (L y) = l (comb lub x y)
hunk ./E/Demand.hs 156
-    lub (S x) (L y) = L (comb lub x y)
-    lub (L x) (S y) = L (comb lub x y)
+    lub (S x) (L y) = l (comb lub x y)
+    lub (L x) (S y) = l (comb lub x y)
hunk ./E/Demand.hs 174
-    glb (L x) (L y) = L (comb glb x y)
+    glb (L x) (L y) = l (comb glb x y)
hunk ./E/Demand.hs 225
-    let g (DemandSignature n dt) = f n demand where
-            f 0 _ = dt
+    let g (DemandSignature n dt@(DemandEnv phi _ :=> _)) = f n demand where
+            f 0 (S _) = dt
hunk ./E/Demand.hs 228
-            f _ _ = absType
+            f _ _ = lazify (DemandEnv phi Absent) :=> []
hunk ./E/Demand.hs 234
-            Just ds -> return (False,g ds)
+            Just ds -> return (True,g ds)
hunk ./E/Demand.hs 285
-analyze e@EError {} _ = return (e,botType)
+analyze e@EError {} (S _) = return (e,botType)
+analyze e@EError {} (L _) = return (e,absType)
hunk ./E/Demand.hs 348
+
+solveDs dataTable ds = do
+    let ds' = [ ((t,e),sig) | (t,e) <- ds, let sig = maybe absSig id (Info.lookup (tvrInfo t))]
+        g False [] ds = return [ (tvrInfo_u (Info.insert (fixupDemandSignature sig)) t,e) | ((t,e),sig) <- ds ]
+        g True [] ds = extEnvs [ (t,sig)| ((t,_),sig) <- ds] $ g False ds []
+        g ch (((t,e),sig):rs) fs = do
+            (ne,sig') <- topAnalyze t e
+            g (ch || (sig' /= sig)) rs (((t,ne),sig'):fs)
+    runIM (g True [] ds') dataTable
+
+