[eta expand main function, be smarter about evaluating pre-evaluated values, call main function directly rather than evaluating its closure
John Meacham <john@repetae.net>**20060405023747] hunk ./E/FromHs.hs 198
-            theMain = (theMainName,setProperty prop_EXPORTED theMainTvr,e)
-            theMainTvr =  tVr (toId theMainName) (infertype dataTable e)
+            ne = ELam worldVar (EAp e (EVar worldVar))
+            worldVar = tvr { tvrIdent = 2, tvrType = tWorld__ }
+            theMain = (theMainName,setProperty prop_EXPORTED theMainTvr,ne)
+            theMainTvr =  tVr (toId theMainName) (infertype dataTable ne)
hunk ./Grin/FromE.hs 148
-    (_,(Tup [] :-> theMain)) <- doCompile ((mainEntry,[],EVar mainEntry))
+    --(_,(Tup [] :-> theMain)) <- doCompile ((mainEntry,[],EVar mainEntry))
+    let theMain = App (scTag mainEntry) [] tyUnit
hunk ./Grin/FromE.hs 175
-            grinFunctions = (funcMain ,(Tup [] :-> App funcInitCafs [] tyUnit :>>= unit :->  theMain )) : ds',
+            grinFunctions = (funcMain ,(Tup [] :-> App funcInitCafs [] tyUnit :>>= unit :->  discardResult theMain)) : ds',
hunk ./Grin/FromE.hs 189
+discardResult exp = case getType exp of
+    TyTup [] -> exp
+    t -> exp :>>= et t :-> Return unit
+    where
+    et (TyTup xs) = Tup (map et xs)
+    et t = Var v0 t
hunk ./Grin/FromE.hs 286
+evalVar tvr | Just CaseDefault <- Info.lookup (tvrInfo tvr)  = do
+        mtick "Grin.FromE.strict-casedefault"
+        return (Fetch (toVal tvr))
+evalVar tvr | getProperty prop_WHNF tvr = do
+        mtick "Grin.FromE.strict-propevaled"
+        return (Fetch (toVal tvr))
+evalVar tvr = return $ gEval (toVal tvr)
+
hunk ./Grin/FromE.hs 313
-    ce (EVar tvr) | Just CaseDefault <- Info.lookup (tvrInfo tvr)  = do
-        mtick "Grin.FromE.strict-casedefault"
-        return (Fetch (toVal tvr))
-    ce (EVar tvr) | getProperty prop_WHNF tvr = do
-        mtick "Grin.FromE.strict-propevaled"
-        return (Fetch (toVal tvr))
hunk ./Grin/FromE.hs 330
-                Nothing -> app fty (gEval $ toVal tvr) as
+                Nothing -> do
+                    ee <- evalVar tvr
+                    app fty ee as
hunk ./Grin/Grin.hs 428
-         else fail $ "App: results do not match: " ++ show a
+         else fail $ "App: results do not match: " ++ show (a,t,(as',t'))
hunk ./Grin/MangleE.hs 80
+        idread n nfo = return nfo