[have the cho collect combinators rather than the ho file
John Meacham <john@repetae.net>**20080222051440] hunk ./E/Rules.hs 77
+instance Eq Rule where
+    r1 == r2 = ruleUniq r1 == ruleUniq r2
hunk ./FlagDump.flags 10
+preprocessed code after preprocessing/deliting
hunk ./Ho/Build.hs 545
+    wdump FD.Preprocessed $ do
+        putStrLn s'
hunk ./Ho/Collected.hs 3
+    choDataTable,
+    choClassHierarchy,
+    choTypeSynonyms,
+    choFixities,
+    choAssumps,
+    choRules,
+    choEs,
hunk ./Ho/Collected.hs 15
+import Data.List
hunk ./Ho/Collected.hs 26
+
+choDataTable = hoDataTable . hoBuild . choHo
+choClassHierarchy = hoClassHierarchy . hoBuild . choHo
+choTypeSynonyms = hoTypeSynonyms . hoBuild . choHo
+choFixities = hoFixities . hoBuild . choHo
+choAssumps = hoAssumps . hoBuild . choHo
+choRules = hoRules . hoBuild . choHo
+choEs cho = [ (combHead c,combBody c) | c <- melems $  choCombinators cho]
+
hunk ./Ho/Collected.hs 40
+        choCombinators = mempty,
hunk ./Ho/Collected.hs 47
+        choCombinators = choCombinators a `mappend` choCombinators b,
hunk ./Ho/Collected.hs 65
+        minfo = tvrInfo ta `mappend` tvrInfo tb
+        minfo' = dex (undefined :: ARules) . dex (undefined :: Properties) $ minfo
+        dex dummy y = g (Info.lookup (tvrInfo tb) `asTypeOf` Just dummy) where
+            g Nothing = y
+            g (Just x) = Info.insertWith mappend x y
+
+-- this will have to merge rules and properties.
+mergeChoCombinators :: IdMap Comb -> IdMap Comb -> IdMap Comb
+mergeChoCombinators x y = munionWith f x y where
+    f c1 c2 = combHead_s (merge (combHead c1) (combHead c2)) c1 { combRules = combRules c1 `Data.List.union`  combRules c2 }
+    merge ta tb = ta { tvrInfo = minfo' }   where
hunk ./Ho/Type.hs 6
-import DataConstructors(DataTable,dataTablePrims)
-import E.E(TVr,E)
+import DataConstructors(DataTable)
hunk ./Ho/Type.hs 8
+import E.Type
hunk ./Ho/Type.hs 32
+    choCombinators  :: IdMap Comb,
hunk ./Main.hs 23
-import E.Annotate(annotate,annotateDs,annotateProgram)
+import E.Annotate(annotate,annotateDs,annotateCombs,annotateProgram)
hunk ./Main.hs 173
-    let finalVarMap = mappend (fromList [(tvrIdent tvr,Just $ EVar tvr) | tvr <- newTVrs ]) $ reRule (choVarMap accumho)
-        newTVrs = map annTVr . fsts $ hoEs (hoBuild aho)
-        annTVr t = dorule rules' t
-
-        --reRule x = if isEmpty orphanRules then x else fmap (fmap rr) x where
-        reRule x = fmap (fmap rr) x where
-            rr ~(EVar t) = EVar $ dorule rules' t
-        dorule rules t = tvrInfo_u (g (tvrIdent t)) t where
-            g id = runIdentity . idann rules mempty id
-        orphanRules = findOrphanRules (Map.keys . hoExports $ hoExp aho) rules'
-        --rules' = (hoRules (hoBuild aho))
-        --rules' = mapRuleBodies (substfmap) (hoRules (hoBuild aho))
-        rules' = mapRuleBodies (substMap'' $ choVarMap accumho) (hoRules (hoBuild aho))
-        substfmap = runIdentity . annotate finalVarMap (\_ -> return) letann lamann
-
-    let ds = runIdentity $ annotateDs (choVarMap accumho) (\_ -> return) letann lamann (hoEs ho')
-        ho' = reprocessHo rules' mempty (hoBuild aho)
-        prog = etaAnnotateProgram (programSetDs ds program { progDataTable = hoDataTable (hoBuild $ choHo accumho) `mappend` hoDataTable (hoBuild aho) })
+    let finalVarMap = mappend (fromList [(tvrIdent tvr,Just $ EVar tvr) | tvr <- newTVrs ]) (choVarMap accumho)
+        newTVrs = fsts $ hoEs (hoBuild aho)
+    let choCombinators = fromList [ (combIdent c,c) | c <- runIdentity $ annotateCombs (choVarMap accumho) (\_ -> return) letann lamann combs]
+        combs = [ (emptyComb { combHead = t, combBody = e }) | (t,e) <- hoEs (hoBuild aho) ]
hunk ./Main.hs 178
+
hunk ./Main.hs 182
-        choHoMap = Map.singleton (show mod) $ hoBuild_u (hoEs_s $ programDs prog) aho
+        choCombinators = choCombinators,
+        --choHoMap = Map.singleton (show mod) $ hoBuild_u (hoEs_s ds') aho
+        choHoMap = Map.singleton (show mod) aho
hunk ./Main.hs 187
+        --reRule x = if isEmpty orphanRules then x else fmap (fmap rr) x where
+--        reRule x = fmap (fmap rr) x where
+--            rr ~(EVar t) = EVar $ dorule rules' t
+--        dorule rules t = tvrInfo_u (g (tvrIdent t)) t where
+--            g id = runIdentity . idann rules mempty id
+--        orphanRules = findOrphanRules (Map.keys . hoExports $ hoExp aho) rules'
+--        --rules' = (hoRules (hoBuild aho))
+--        --rules' = mapRuleBodies (substfmap) (hoRules (hoBuild aho))
+--        rules' = mapRuleBodies (substMap'' $ choVarMap accumho) (hoRules (hoBuild aho))
+--        substfmap = runIdentity . annotate finalVarMap (\_ -> return) letann lamann
+--
+--    let ds = runIdentity $ annotateDs (choVarMap accumho) (\_ -> return) letann lamann (hoEs ho')
+--        ho' = reprocessHo rules' mempty (hoBuild aho)
+--        prog = etaAnnotateProgram (programSetDs ds program { progDataTable = hoDataTable (hoBuild $ choHo accumho) `mappend` hoDataTable (hoBuild aho) })
+--        (mod:_) = Map.keys $ hoExports $ hoExp aho
+--    return $ mempty {
+--        choVarMap = finalVarMap,
+--        choExternalNames = fromList . map tvrIdent $ newTVrs,
+--        choHoMap = Map.singleton (show mod) $ hoBuild_u (hoEs_s $ programDs prog) aho
+--        } `mappend` accumho
+
hunk ./Main.hs 473
-    return (mempty { choHoMap = Map.singleton (show mod) ho' { hoBuild = newHoBuild}, choExternalNames = idMapToIdSet newMap, choVarMap = newMap  } `mappend` cho,ho' { hoBuild = newHoBuild })
+    return (mempty {
+        choHoMap = Map.singleton (show mod) ho' { hoBuild = newHoBuild},
+        choCombinators = fromList $ [ (tvrIdent t,emptyComb { combHead = t, combBody = e }) | (t,e) <- hoEs newHoBuild ],
+        choExternalNames = idMapToIdSet newMap,
+        choVarMap = newMap
+        } `mappend` cho,ho' { hoBuild = newHoBuild })
hunk ./Main.hs 513
-    let ho = choHo cho
hunk ./Main.hs 516
-        rules = hoRules $ hoBuild ho
-        prog = hoToProgram ho
-        hoToProgram :: Ho -> Program
-        hoToProgram ho = programSetDs (hoEs $ hoBuild ho) program {
-            progClassHierarchy = hoClassHierarchy $ hoBuild ho,
-            progDataTable = hoDataTable $ hoBuild ho
+        rules = choRules cho
+        prog = programUpdate program {
+            progCombinators = melems $ choCombinators cho,
+            progClassHierarchy = choClassHierarchy cho,
+            progDataTable = choDataTable cho
hunk ./Main.hs 527
-        printClassSummary (hoClassHierarchy $ hoBuild ho)
+        printClassSummary (choClassHierarchy cho)
hunk ./Main.hs 530
-        printClassHierarchy (hoClassHierarchy $ hoBuild ho)
+        printClassHierarchy (choClassHierarchy cho)