[make strictness analysis pass lambda info to sub-functions. enable full workerwrappering, collect workerwrapper statistics
John Meacham <john@repetae.net>**20051024045956] {
hunk ./E/Strictness.hs 36
---    | U [SA]  -- Unary Constructor.
hunk ./E/Strictness.hs 46
+isLam Lam {} = True
+isLam _ = False
hunk ./E/Strictness.hs 59
-    let idclear _ nfo = return $ Info.delete L nfo
+    let idclear _ nfo = return $ Info.delete L (Info.delete [L] nfo)
hunk ./E/Strictness.hs 63
-    let idm = Map.fromList $ [ (tvrIdent x,y) | (x,y) <- cr]
-    --mapM_ (\ (tvr,n) -> print (tvrShowName tvr,n)) cr
-    let idann id nfo = case Map.lookup id idm of
-            Just x -> return $ Info.insert x nfo
-            Nothing -> return nfo -- error $ "Could not find :" ++ tvrShowName tvr { tvrIdent = id }
+    let idm = Map.fromList $ [ (tvrIdent x,y) | (x,y) <- cr, not (isLam y)]
+        lmap = Map.fromList $ [ (tvrIdent x,y) | (x,y) <- cr, isLam y]
+    --mapM_ (\ (tvr,n) -> print (tvrShowName tvr,n)) vs
+    let idann id nfo = nfo'' where
+            nfo'' = case Map.lookup id lmap of
+                Just (Lam xs) -> return $ Info.insert xs nfo'
+                Nothing -> return nfo'
+                _ -> error "solveDs: odd lam"
+            nfo' = case Map.lookup id idm of
+                Just x ->  Info.insert x nfo
+                Nothing ->  nfo -- error $ "Could not find :" ++ tvrShowName tvr { tvrIdent = id }
hunk ./E/WorkerWrapper.hs 4
+import Control.Monad.Writer
hunk ./E/WorkerWrapper.hs 22
-import qualified Stats
+import Stats
hunk ./E/WorkerWrapper.hs 37
-    Lam sa = maybe (Lam (repeat L)) id (Info.lookup (tvrInfo tvr))
+    sa = maybe ((repeat L)) id (Info.lookup (tvrInfo tvr))
hunk ./E/WorkerWrapper.hs 49
-
-
hunk ./E/WorkerWrapper.hs 51
+workWrap = undefined
+
+{-
hunk ./E/WorkerWrapper.hs 57
-
+-}
hunk ./E/WorkerWrapper.hs 66
-workWrap' :: Monad m => DataTable -> TVr -> E -> m ((TVr,E),(TVr,E))
+workWrap' :: MonadStats m => DataTable -> TVr -> E -> m ((TVr,E),(TVr,E))
hunk ./E/WorkerWrapper.hs 80
-    ans = return ((setProperty prop_WRAPPER tvr,wrapper),(setProperty prop_WORKER tvr',worker))
+    ans = doTicks >> return ((setProperty prop_WRAPPER tvr,wrapper),(setProperty prop_WORKER tvr',worker))
hunk ./E/WorkerWrapper.hs 101
+    doTicks = do
+        case cname of
+            Just n -> mtick ("E.Workwrap.CPR.{" ++ tvrShowName tvr ++ "." ++ show n ++ "}")
+            _ -> return ()
+        flip mapM_ sargs $ \ x -> case x of
+            (Just (n,_),_) ->  mtick ("E.Workwrap.arg.{" ++ tvrShowName tvr ++ "." ++ show (conName n) ++ "}")
+            _ -> return ()
hunk ./E/WorkerWrapper.hs 114
-performWorkWrap dataTable ds = runIdentity $ Stats.runStatT (wwDs ds) where
-    wwDs :: [(TVr,E)] -> Stats.StatT Identity [(TVr,E)]
+performWorkWrap dataTable ds = runWriter (wwDs ds) where
+    --wwDs :: [(TVr,E)] -> Stats.StatT Identity [(TVr,E)]
hunk ./E/WorkerWrapper.hs 117
-    wwDef :: (TVr,E) -> Stats.StatT Identity [(TVr,E)]
-    wwDef (tvr,e) = case workWrap' dataTable tvr e of
-        Just ((tx,x),(ty,y)) -> do
-            Stats.mtick a_workWrap
+    --wwDef :: (TVr,E) -> Stats.StatT Identity [(TVr,E)]
+    wwDef (tvr,e) = case runStatT (workWrap' dataTable tvr e) of
+        Just (((tx,x),(ty,y)),st) -> do
+            --Stats.mtick a_workWrap
+            tell st
hunk ./E/WorkerWrapper.hs 127
-    wwE :: E -> Stats.StatT Identity E
+    --wwE :: E -> Stats.StatT Identity E
hunk ./Main.hs 215
-        cds' <- return $ concatMap (uncurry (workWrap fullDataTable)) cds
-        -- let (cds',st) = performWorkWrap fullDataTable cds
-        --Stats.tickStat stats st
+        --cds' <- return $ concatMap (uncurry (workWrap fullDataTable)) cds
+        let (cds',st) = performWorkWrap fullDataTable cds
+        Stats.tickStat stats st
hunk ./Main.hs 267
-    wdump FD.OptimizationStats $ Stats.print "Optimization" stats
+    --wdump FD.OptimizationStats $ Stats.print "Optimization" stats
+    Stats.print "Optimization" stats
}
