[add typing rules for left section and clean up typing of applications
John Meacham <john@repetae.net>**20051211084109] hunk ./FrontEnd/Tc/Main.hs 21
+import GenUtil
hunk ./FrontEnd/Tc/Main.hs 39
---tcApps e as typ = f e as typ [] where
---    f e (a:as) typ rs = do
---        (e1,e2) <- tcApp e a typ
+tcApps e as typ = do
+    bs <- sequence [ newBox Star | _ <- as ]
+    e' <- tiExpr e (foldr fn typ (snds bs))
+    rs <- sequence (fsts bs)
+    as' <- sequence [ tiExprPoly a r | r <- rs | a <- as ]
+    return (e',as')
hunk ./FrontEnd/Tc/Main.hs 100
+tiExpr (HsLeftSection e1 e2) typ = do
+    (e1,e2) <- tcApp e1 e2 typ
+    return (HsLeftSection e1 e2)
+
+-- I know this looks weird but it appears to be correct
+-- e1 :: b
+-- e2 :: a -> b -> c
+-- e1 e2 :: a -> c
+
+-- (: [])  \x -> x : []   `fn`
+
+--tiExpr (HsRightSection e1 e2) typ = do
+--        (e2,e1) <- tcApp e2 e1 typ
+--        return (HsRightSection e1 e2)
+--        (rb,box) <- newBox Star
+--        tcExpr e2 (box `fn` )
+--        (e1Ps, envE1, e1T) <- tiExpr env e1
+--        (e2Ps, envE2, e2T) <- tiExpr env e2
+--        tv1         <- newTVar Star
+--        tv2         <- newTVar Star
+--        unify e2T (tv1 `fn` (e1T `fn` tv2))
+--        return (e1Ps ++ e2Ps, envE1 `Map.union` envE2, tv1 `fn` tv2)
+
hunk ./FrontEnd/Tc/Main.hs 130
-    (HsApp e2 e1,e3) <- tcApp (HsApp e2 e1) e3 typ   -- TODO, preserve
-    return (HsInfixApp e1 e2 e3)
+    (e2',[e1',e3']) <- tcApps e2 [e1,e3] typ
+    -- (HsApp e2 e1,e3) <- tcApp (HsApp e2 e1) e3 typ   -- TODO, preserve
+    return (HsInfixApp e1' e2' e3')
hunk ./FrontEnd/Tc/Main.hs 181
-    apps <- tiExpr (foldl HsApp (HsCon (toTuple (length exps))) exps) typ
-    let f (HsApp a b) exps = f a (b:exps)
-        f (HsCon {}) exps = reverse exps
-    return $ HsTuple (f apps [])
-    --psasts <- mapM tiExpr exps
-    --let typeList = map trd3 psasts
-    --let preds = concatMap fst3 psasts
-    --let env1 = Map.unions $ map snd3 psasts
-    --return (preds, env1, tTTuple typeList)
-
+    (HsCon _,exps') <- tcApps (HsCon (toTuple (length exps))) exps typ
+    return (HsTuple exps')
hunk ./FrontEnd/Tc/Main.hs 187
-        --v <- newTVar Star
-        (_,box) <- newBox Star
-        (TAp tList box) `subsumes` typ
+        v <- newTVar Star
+        --(_,box) <- newBox Star
+        (TAp tList v) `subsumes` typ
hunk ./FrontEnd/Tc/Main.hs 213
-    (ds,rs) <- (split ch tvs ds)
+    (ds,rs) <- (Class.split ch tvs ds)
hunk ./FrontEnd/Tc/Main.hs 230
+        --(_,v) <- newBox Star
hunk ./FrontEnd/Tc/Main.hs 977
-        v <- newTVar Star
+        --v <- newTVar Star
+        (_,v) <- newBox Star
hunk ./FrontEnd/Tc/Main.hs 983
-        v <- newTVar Star
+        --v <- newTVar Star
+        (_,v) <- newBox Star