[get rid of IntMap and IntSet versions of subst.
John Meacham <john@repetae.net>**20051013045323] hunk ./DataConstructors.hs 301
-            subst = substMap $ IM.fromList [ (tvrIdent tv ,EVar $ tv { tvrIdent = p }) | EVar tv <- xs | p <- [2,4..] ]
+            subst = substMap $ Map.fromList [ (tvrIdent tv ,EVar $ tv { tvrIdent = p }) | EVar tv <- xs | p <- [2,4..] ]
hunk ./DataConstructors.hs 324
-    sub = substMap $ IM.fromList [ (i,sl) | sl <- xs | i <- [2,4..] ]
+    sub = substMap $ Map.fromDistinctAscList [ (i,sl) | sl <- xs | i <- [2,4..] ]
hunk ./E/Rules.hs 174
-            let b = substMap (IM.fromList [ (i,x) | ~(~(EVar (TVr { tvrIdent = i })),x) <- concat ss ]) (ruleBody r)
+            let b = substMap (Map.fromList [ (i,x) | ~(~(EVar (TVr { tvrIdent = i })),x) <- concat ss ]) (ruleBody r)
hunk ./E/Subst.hs 1
-module E.Subst(subst,subst',eAp, substMap,substMap',doSubst,typeSubst,typeSubst',substMap'',litSMapM ) where
+module E.Subst(subst,subst',eAp, substMap,doSubst,typeSubst,typeSubst',substMap'',litSMapM ) where
hunk ./E/Subst.hs 9
-import qualified Data.IntMap as IM
-import qualified Data.IntSet as IS
hunk ./E/Subst.hs 10
-import qualified Data.Set as Set
hunk ./E/Subst.hs 53
-substMapScope :: IM.IntMap E -> IS.IntSet -> E -> E
-substMapScope im ss e = substMapScope' False im ss e
-
-substMapScope' :: Bool -> IM.IntMap E -> IS.IntSet -> E -> E
-substMapScope' allShadow im ss e = doSubst False allShadow (Map.fromAscList [ (x,Just y) |  (x,y) <-  IM.toAscList im] `Map.union` Map.fromAscList [ (x,Nothing) | x <- IS.toAscList ss ]) e
-
hunk ./E/Subst.hs 56
-substMap :: IM.IntMap E -> E -> E
-substMap im e = substMapScope im (IS.unions $ freeVars e: (map freeVars (IM.elems im))) e
hunk ./E/Subst.hs 57
-substMap' :: Map.Map Id E -> E -> E
-substMap' im e = doSubst False False (Map.fromList [ (x,Map.lookup x im) | x <- (freeVars e ++ freeVars (Map.elems im)) ]) e
+substMap :: Map.Map Id E -> E -> E
+--substMap im e = doSubst False False (Map.fromList [ (x,Map.lookup x im) | x <- (freeVars e ++ freeVars (Map.elems im)) ]) e
+substMap im e = doSubst False False (Map.map ( (`Map.lookup` im) . tvrIdent) (Map.unions $ (freeVars e :: Map.Map Id TVr):map freeVars (Map.elems im))) e
hunk ./E/Subst.hs 165
-typeSubst' termSub typeSub e = typeSubst  (Map.map Just termSub `Map.union` Map.fromAscList [ (x,Map.lookup x termSub) | x <- fvs]) typeSub e  where
-    fvs = Set.toAscList (freeVars e `Set.union` fvmap termSub `Set.union` fvmap typeSub)
-    fvmap m = Set.unions (map freeVars (Map.elems m))
+--typeSubst' termSub typeSub e = typeSubst  (Map.map Just termSub `Map.union` Map.fromAscList [ (x,Map.lookup x termSub) | x <- fvs]) typeSub e  where
+--    fvs = Set.toAscList (freeVars e `Set.union` fvmap termSub `Set.union` fvmap typeSub)
+--    fvmap m = Set.unions (map freeVars (Map.elems m))
+typeSubst' termSub typeSub e = typeSubst  (Map.map Just termSub `Map.union` Map.map ((`Map.lookup` termSub) . tvrIdent) fvs) typeSub e  where
+    fvs :: Map.Map Id TVr
+    fvs = (freeVars e `Map.union` fvmap termSub `Map.union` fvmap typeSub)
+    fvmap m = Map.unions (map freeVars (Map.elems m))
hunk ./Main.hs 11
-import qualified Data.IntMap as IM
hunk ./Main.hs 262
-    fvs <- return $ foldr IM.delete (freeVars lc)  inscope
-    when (IM.size fvs > 0 && dump FD.Progress) $ do
-        putDocM putErr $ parens $ text "Absurded vars:" <+> align (hsep $ map pprint (IM.elems fvs))
+    fvs <- return $ foldr Map.delete (freeVars lc)  inscope
+    when (Map.size fvs > 0 && dump FD.Progress) $ do
+        putDocM putErr $ parens $ text "Absurded vars:" <+> align (hsep $ map pprint (Map.elems fvs))
hunk ./Main.hs 266
-    lc <- mangle (return ()) False ("Absurdize") (return . substMap (IM.map g fvs)) lc
+    lc <- mangle (return ()) False ("Absurdize") (return . substMap (Map.map g fvs)) lc