[collect applications to typecheck as a group. fix case where metavar meets itself
John Meacham <john@repetae.net>**20051214003144] hunk ./FrontEnd/Tc/Main.hs 46
-
hunk ./FrontEnd/Tc/Main.hs 47
-    bt <- newBox Star
-    e1 <- tcExpr e1 (bt `fn` typ)
-    e2 <- tcExprPoly e2 bt  -- TODO Poly
+    (e1,[e2]) <- tcApps e1 [e2] typ
hunk ./FrontEnd/Tc/Main.hs 130
-tiExpr expr@(HsApp e1 e2) typ = withContext (makeMsg "in the application" $ render $ ppHsExp expr) $ do
-    (e1,e2) <- tcApp e1 e2 typ
-    return (HsApp e1 e2)
+tiExpr expr@HsApp {} typ = withContext (makeMsg "in the application" $ render $ ppHsExp $ backToApp h as) $ do
+    (h,as) <- tcApps h as typ
+    return $ backToApp h as
+    where
+    backToApp h as = foldl HsApp h as
+    (h,as) = fromHsApp expr
+    fromHsApp t = f t [] where
+        f (HsApp a b) rs = f a (b:rs)
+        f t rs = (t,rs)
hunk ./FrontEnd/Tc/Main.hs 142
-    -- (HsApp e2 e1,e3) <- tcApp (HsApp e2 e1) e3 typ   -- TODO, preserve
hunk ./FrontEnd/Tc/Unify.hs 115
+    bm (TMetaVar v1) (TMetaVar v2) | v1 == v2 = return False