[annotate constructors with newtypes in more places, perform type application substitution more eagerly in places, newtype annotate data read from disk
John Meacham <john@repetae.net>**20061013002957] hunk ./E/SSimplify.hs 124
-    f (ELit lc@LitCons { litName = n, litArgs = as, litType = t }) = arg $ do
+    f (ELit lc@LitCons { litArgs = as, litType = t }) = arg $ do
hunk ./E/SSimplify.hs 588
-                let wtd = ELit $ litCons { litName = n, litArgs = map EVar ts, litType = te }
-                return $ Alt litCons { litName = n, litArgs = ts, litType = te } (eLet b wtd d)
+                let wtd = ELit $ updateLit (so_dataTable sopts) litCons { litName = n, litArgs = map EVar ts, litType = te }
+                return $ Alt (updateLit (so_dataTable sopts) litCons { litName = n, litArgs = ts, litType = te }) (eLet b wtd d)
hunk ./E/Subst.hs 167
+eAp (ELam t b) e = subst t e b
hunk ./E/Subst.hs 170
+eAp (ELit LitCons { litArgs = es, litAliasFor = Just af }) b = foldl eAp af (es ++ [b])
+eAp a@ELit {} b = error $ "very strange application: " ++ show (a,b)
hunk ./E/TypeCheck.hs 81
-typ (EAp (ELit lc@LitCons { litAliasFor = Just af }) b) = getType (foldl EAp af (litArgs lc ++ [b]))
+-- XXX the following should never occur
+typ (EAp (ELit lc@LitCons { litAliasFor = Just af }) b) = getType (foldl eAp af (litArgs lc ++ [b]))
hunk ./E/WorkerWrapper.hs 90
-        f (Cons c ts,t) = [(t,ELit (litCons { litName = conName c, litArgs = map EVar (snds ts), litType = getType t }))] ++ concatMap f ts
+        f (Cons c ts,t) = [(t,ELit (updateLit dataTable litCons { litName = conName c, litArgs = map EVar (snds ts), litType = getType t }))] ++ concatMap f ts
hunk ./E/WorkerWrapper.hs 95
-        f ((Cons c ts,t):rs) = eCase (EVar t) [Alt (litCons { litName = conName c, litArgs = snds ts, litType = getType t }) (f (ts ++ rs))] Unknown
+        f ((Cons c ts,t):rs) = eCase (EVar t) [Alt (updateLit dataTable litCons { litName = conName c, litArgs = snds ts, litType = getType t }) (f (ts ++ rs))] Unknown
hunk ./E/WorkerWrapper.hs 102
-                cb = Alt (litCons { litName = cname, litArgs = vars, litType = bodyTyp }) (if isSingleton then EVar sv else (ELit $ unboxedTuple (map EVar vars)))
+                cb = Alt (updateLit dataTable litCons { litName = cname, litArgs = vars, litType = bodyTyp }) (if isSingleton then EVar sv else (ELit $ unboxedTuple (map EVar vars)))
hunk ./E/WorkerWrapper.hs 106
-        ne | Just cname <- cname, isSingleton = cases $ eStrictLet sv workerCall  (ELit $ litCons { litName = cname, litArgs = [EVar sv], litType = bodyTyp })
-           | Just cname <- cname = let ca = Alt (unboxedTuple vars) (ELit $ litCons { litName = cname, litArgs = (map EVar vars), litType = bodyTyp }) in  cases $ eCase workerCall [ca] Unknown
+        ne | Just cname <- cname, isSingleton = cases $ eStrictLet sv workerCall  (ELit $ updateLit dataTable litCons { litName = cname, litArgs = [EVar sv], litType = bodyTyp })
+           | Just cname <- cname = let ca = Alt (unboxedTuple vars) (ELit $ updateLit dataTable litCons { litName = cname, litArgs = (map EVar vars), litType = bodyTyp }) in  cases $ eCase workerCall [ca] Unknown
hunk ./Main.hs 168
-
-{-
+          {-
hunk ./Main.hs 176
-    denewtype prog | null $ progCombinators prog = prog
-    denewtype prog = prog' where
-        ELetRec ds _ = removeNewtypes (progDataTable prog) (programE prog)
-        Identity prog' = annotateProgram mempty (\_ nfo -> return nfo)  (\_ nfo -> return nfo) (\_ nfo -> return nfo) (programSetDs ds prog)
--}
+        -}
+denewtype prog | null $ progCombinators prog = prog
+denewtype prog = prog' where
+    ELetRec ds _ = removeNewtypes (progDataTable prog) (programE prog)
+    prog' = programSetDs ds prog
+--    Identity prog' = annotateProgram mempty (\_ nfo -> return nfo)  (\_ nfo -> return nfo) (\_ nfo -> return nfo) (programSetDs ds prog)
hunk ./Main.hs 206
-        prog = etaAnnotateProgram (programSetDs ds program)
+        prog = etaAnnotateProgram (denewtype $ programSetDs ds program { progDataTable = hoDataTable accumho `mappend` hoDataTable ho })
hunk ./Main.hs 210
+
hunk ./Main.hs 760
+    boxify (EAp (ELam t b) e) = boxify (subst t e b)