[modify type checker for type based translation
John Meacham <john@repetae.net>**20051208081815] hunk ./FrontEnd/Class.hs 54
+    simplify,
hunk ./FrontEnd/Tc/Main.hs 4
+import Control.Monad.Writer
hunk ./FrontEnd/Tc/Main.hs 29
-fst3 :: (a,b,c) -> a
-fst3 (a,_,_) = a
-snd3 :: (a,b,c) -> b
-snd3 (_,b,_) = b
-trd3 :: (a,b,c) -> c
-trd3 (_,_,c) = c
-
hunk ./FrontEnd/Tc/Main.hs 46
+addPreds :: [Pred] -> Tc ()
+addPreds = tell
hunk ./FrontEnd/Tc/Main.hs 49
-tiExpr ::  HsExp -> Type ->  Tc [Pred]
+tiExpr ::  HsExp -> Type ->  Tc HsExp
hunk ./FrontEnd/Tc/Main.hs 55
+    addPreds ps
hunk ./FrontEnd/Tc/Main.hs 57
-    return ps
+    return (HsVar v)
hunk ./FrontEnd/Tc/Main.hs 60
-      sc <- lookupName (toName DataConstructor conName)
-      ((ps :=> t)) <- freshInst sc
-      unify t typ
-      return ps
+    sc <- lookupName (toName DataConstructor conName)
+    ((ps :=> t)) <- freshInst sc
+    unify t typ
+    addPreds ps
+    return (HsCon conName)
hunk ./FrontEnd/Tc/Main.hs 67
-    (ps,t) <- tiLit l
+    t <- tiLit l
hunk ./FrontEnd/Tc/Main.hs 69
-    return ps
+    return (HsLit l)
hunk ./FrontEnd/Tc/Main.hs 72
-    --(br,bt) <- newBox
-    ps <- tiExpr e typ
-    --t <- br
+    e <- tiExpr e typ
hunk ./FrontEnd/Tc/Main.hs 74
-    return ps
+    return (HsAsPat n e)
hunk ./FrontEnd/Tc/Main.hs 78
-    ps <- tiExpr e1 (bt `TArrow` typ)
+    e1 <- tiExpr e1 (bt `TArrow` typ)
hunk ./FrontEnd/Tc/Main.hs 80
-    qs <- tiExpr e2 t
-    return (ps ++ qs)
+    e2 <- tiExpr e2 t
+    return (HsApp e1 e2)
hunk ./FrontEnd/Tc/Main.hs 90
-        ps <- tiExpr e typ
-        return (IsIn class_Num typ : ps)
+        e <- tiExpr e typ
+        addPreds [IsIn class_Num typ]
+        return (HsNegApp e)
hunk ./FrontEnd/Tc/Main.hs 110
-    ps <- tiExpr e tBool
-    qs <- tiExpr e1 typ
-    rs <- tiExpr e2 typ
-    return (ps ++ qs ++ rs)
+    e <- tiExpr e tBool
+    e1 <- tiExpr e1 typ
+    e2 <- tiExpr e2 typ
+    return (HsIf e e1 e2)
hunk ./FrontEnd/Tc/Main.hs 117
-
-
hunk ./FrontEnd/Tc/Main.hs 128
-tiPat :: HsPat -> Type -> Tc ([Pred], Map.Map Name Scheme)
+tiPat :: HsPat -> Type -> Tc (HsPat, Map.Map Name Scheme)
hunk ./FrontEnd/Tc/Main.hs 135
-        return ([], Map.singleton (toName Val i) (toScheme v))
+        return (HsPVar i, Map.singleton (toName Val i) (toScheme v))
hunk ./FrontEnd/Tc/Main.hs 138
-    (ps, t) <- tiLit l
+    t <- tiLit l
hunk ./FrontEnd/Tc/Main.hs 140
-    return (ps, Map.empty)
+    return (HsPLit l,Map.empty)
hunk ./FrontEnd/Tc/Main.hs 917
-tiLit            :: HsLiteral -> Tc ([Pred],Type)
-tiLit (HsChar _) = return ([], tChar)
+tiLit :: HsLiteral -> Tc Tau
+tiLit (HsChar _) = return tChar
hunk ./FrontEnd/Tc/Main.hs 921
-        return ([IsIn class_Num v], v)
+        addPreds [IsIn class_Num v]
+        return v
hunk ./FrontEnd/Tc/Main.hs 926
-        return ([IsIn class_Fractional v], v)
+        addPreds [IsIn class_Fractional v]
+        return v
hunk ./FrontEnd/Tc/Main.hs 929
-tiLit (HsString _)  = return ([], tString)
+tiLit (HsString _)  = return tString
hunk ./Interactive.hs 4
+import Control.Monad.Writer
hunk ./Interactive.hs 29
+import Class
hunk ./Interactive.hs 216
-    ps <- tiExpr e box
+    (_,ps') <- listen $ tiExpr e box
hunk ./Interactive.hs 218
+    let ps = Class.simplify (hoClassHierarchy ho) ps'
hunk ./Interactive.hs 233
-{-
-    let thisFixityMap = buildFixityMap (concat [ filter isHsInfixDecl (hsModuleDecls $ modInfoHsModule m) | m <- ms])
-    let fixityMap = thisFixityMap `mappend` hoFixities me
-    let thisTypeSynonyms =  (declsToTypeSynonyms $ concat [ filter isHsTypeDecl (hsModuleDecls $ modInfoHsModule m) | m <- ms])
-    let ts = thisTypeSynonyms  `mappend` hoTypeSynonyms me
-    let f x = expandTypeSyns ts (modInfoHsModule x) >>= FrontEnd.Infix.infixHsModule fixityMap >>= \z -> return (modInfoHsModule_s ( z) x)
--}