[merge independent graph libraries, fill out some useful routines, clean up some handling of built in types
John Meacham <john@repetae.net>**20090811134018
 Ignore-this: 44e5168aed7ec1135e0b2ec64d883f9d
] hunk ./lib/jhc/Jhc/Inst/Storable.hs 43
-type BitsWchar_ = Bits32_
-type BitsSize_ = BitsPtr_
-type Bitsize_ = BitsPtr_
+--type BitsWchar_ = Bits32_
+--type BitsSize_ = BitsPtr_
+--type BitsInt_ = Bits32_
hunk ./lib/jhc/Jhc/Inst/Storable.hs 53
+--XINST_STORABLE_XXX(CWchar,BitsWchar_,bits32)
hunk ./lib/jhc/Jhc/Types.hs 24
+data BitsSize_ :: #
+data BitsWchar_ :: #
+
hunk ./regress/regress.prl 9
-use POSIX qw(strftime SIGINT);
+use POSIX  qw(strftime SIGINT);
hunk ./regress/regress.prl 144
-my @libs = $opt_l ? () : ("--noauto", "-i$jhc_dir/lib/base","-i$jhc_dir/lib/haskell98");
+my @libs = $opt_l ? () : ("--noauto", "-i$jhc_dir/lib/jhc", "-i$jhc_dir/lib/base","-i$jhc_dir/lib/haskell98");
hunk ./regress/regress.prl 228
-    return defined $_[0] ? ($_[0] == 64512 || ($_[0] & 127) == SIGINT  ? "INT" : $_[0] == 35072 || ($_[0] & 127) ==  24 ? "TIME" : $_[0]) : "-";
+    return defined $_[0] ? ($_[0] == 64512 || ($_[0] & 127) == SIGINT()  ? "INT" : $_[0] == 35072 || ($_[0] & 127) ==  24 ? "TIME" : $_[0]) : "-";
hunk ./src/DataConstructors.hs 834
+    (tc_BitsInt, rt_bits_int_),
+    (tc_BitsWchar, rt_bits_wchar_t_),
+    (tc_BitsSize, rt_bits_size_t_),
hunk ./src/DataConstructors.hs 896
+    (tc_BitsSize, "size_t"),
+    (tc_BitsWchar, "wchar_t"),
+    (tc_BitsInt, "Int"),
hunk ./src/E/LetFloat.hs 172
-    g = G.reachable (G.newGraph (concatMap G.fromScc xs) (combIdent . fst) (idSetToList . snd)) (fvs `mappend` unsafe_ones)
+    g = G.reachableFrom  (combIdent . fst) (idSetToList . snd) (concatMap G.fromScc xs ) (fvs `mappend` unsafe_ones)
hunk ./src/E/SSimplify.hs 230
-    let graph = newGraph ds' (\ ((comb,_),_) -> combIdent comb) (\ ((_,rv),fv) -> mkeys (fv `mappend` rv))
-        rds = reachable graph (mkeys fve ++ [ combIdent t | t <- ds,  (combIdent t `member` exp)])
+    let (reachable',graph) = newGraphReachable ds' (\ ((comb,_),_) -> combIdent comb) (\ ((_,rv),fv) -> mkeys (fv `mappend` rv))
+        rds = reachable' (mkeys fve ++ [ combIdent t | t <- ds,  (combIdent t `member` exp)])
hunk ./src/Grin/Optimize.hs 75
-        let graph = newGraph xs pexpUniq pexpDeps
+        let (reachable',graph) = newGraphReachable xs pexpUniq pexpDeps
hunk ./src/Grin/Optimize.hs 77
-            reached = reachable graph deps
+            reached = reachable' deps
hunk ./src/Grin/Simplify.hs 596
-        graph = newGraph uf (\ ((a,_),_) -> a) (\ (_,(fi,fd)) -> (if postEval then [] else fi) ++ fd)
-        rf = reachable graph (grinEntryPointNames grin)
+        (reachable,graph) = newGraphReachable uf (\ ((a,_),_) -> a) (\ (_,(fi,fd)) -> (if postEval then [] else fi) ++ fd)
+        rf = reachable (grinEntryPointNames grin)
hunk ./src/Ho/Build.hs 69
-import qualified Util.Graph2 as G
+import qualified Util.Graph as G
hunk ./src/Ho/Build.hs 359
-                        (_,False) -> noGood (show (isGood,libsGood))
+                        (_,False) -> noGood ""
hunk ./src/Ho/Build.hs 374
- --   putStrLn "grr"
- --   mapM_ print [ (snd $ snd v, map (snd . snd) vs) | (v,vs) <- G.fromGraph gr']
+    when (dump FD.SccModules) $ do
+        putErrLn "ComponentsDeps:"
+        mapM_ (putErrLn . show) [ (snd $ snd v, map (snd . snd) vs) | (v,vs) <- G.fromGraph gr']
hunk ./src/Main.hs 420
-    ds' = reachable (newGraph (progCombinators prog) combIdent freeVars) (toList $ progEntry prog)
+    ds' = reachableFrom combIdent freeVars (progCombinators prog) (toList $ progEntry prog)
hunk ./src/Main.hs 496
-    prog <- return prog { progMain   = tvrIdent main,
+    prog <- return $ programUpdate prog { progMain   = tvrIdent main,
hunk ./src/Util/Graph.hs 4
-module Util.Graph where
+module Util.Graph(
+    Graph(),
+    fromGraph,
+    newGraph,
+    newGraph',
+    newGraphReachable,
+    reachableFrom,
+    Util.Graph.reachable,
+    fromScc,
+    findLoopBreakers,
+    sccGroups,
+    Util.Graph.scc,
+    sccForest,
+    Util.Graph.dff,
+    Util.Graph.components,
+    Util.Graph.topSort,
+    cyclicNodes,
+    toDag,
+    restitchGraph,
+    mapGraph,
+    transitiveClosure,
+    transitiveReduction
+    ) where
hunk ./src/Util/Graph.hs 28
-import Data.Array
+import Control.Monad
+import Control.Monad.ST
+import Data.Array.IArray
+import Data.Array.ST
hunk ./src/Util/Graph.hs 33
+import Data.Maybe
hunk ./src/Util/Graph.hs 37
+import qualified Data.Map as Map
hunk ./src/Util/Graph.hs 40
-data Graph n k = Graph G.Graph (Vertex -> n) (k -> Maybe Vertex) (n -> k)
+data Graph n = Graph G.Graph (Table n)
hunk ./src/Util/Graph.hs 42
-instance Show n => Show (Graph n k) where
+
+instance Show n => Show (Graph n) where
hunk ./src/Util/Graph.hs 46
-fromGraph :: Graph n k -> [(n,[n])] 
-fromGraph (Graph g lv _ _) = [ (lv v,map lv vs) | (v,vs) <- assocs g ] 
+fromGraph :: Graph n -> [(n,[n])]
+fromGraph (Graph g lv) = [ (lv!v,map (lv!) vs) | (v,vs) <- assocs g ]
+
+newGraph :: Ord k => [n] -> (n -> k) -> (n -> [k]) -> (Graph n)
+newGraph ns a b = snd $ newGraph' ns a b
+
+newGraphReachable :: Ord k => [n] -> (n -> k) -> (n -> [k]) -> ([k] -> [n],Graph n)
+newGraphReachable ns fn fd = (rable,ng) where
+    (vmap,ng) = newGraph' ns fn fd
+    rable ks = Util.Graph.reachable ng [ v | Just v <- map (flip Map.lookup vmap) ks ] 
hunk ./src/Util/Graph.hs 57
-newGraph :: Ord k => [n] -> (n -> k) -> (n -> [k]) -> Graph n k
-newGraph ns fn fd = Graph ans lv' kv fn where
-    (ans,lv,kv) = graphFromEdges [ (n,fn n,snub $ fd n) | n <- ns ]
-    lv' x | (n,_,_) <- lv x = n
+reachableFrom :: Ord k => (n -> k) -> (n -> [k]) -> [n] -> [k] -> [n]
+reachableFrom fn fd ns  = fst $ newGraphReachable ns fn fd
+
+-- | Build a graph from a list of nodes uniquely identified by keys,
+-- with a list of keys of nodes this node should have edges to.
+-- The out-list may contain keys that don't correspond to
+-- nodes of the graph; they are ignored.
+newGraph' :: Ord k => [n] -> (n -> k) -> (n -> [k]) -> (Map.Map k Vertex,Graph n)
+newGraph' ns fn fd = (kmap,Graph graph nr) where
+    nr = listArray bounds0 ns
+    max_v      	    = length ns - 1
+    bounds0         = (0,max_v) :: (Vertex, Vertex)
+    kmap = Map.fromList [ (fn n,i) | (i,n) <- zip [0 ..] ns ]
+    graph	    = listArray bounds0 [mapMaybe (flip Map.lookup kmap) (snub $ fd n) | n <- ns]
hunk ./src/Util/Graph.hs 77
-findLoopBreakers ::
-    (n -> Int)    -- ^ fitness function, greater numbers mean more likely to be a loopbreaker
+findLoopBreakers
+    :: (n -> Int)  -- ^ fitness function, greater numbers mean more likely to be a loopbreaker
hunk ./src/Util/Graph.hs 80
-    -> Graph n k  -- ^ the graph
-    ->  ([n],[n]) -- ^ (loop breakers,dependency ordered nodes after loopbreaking)
-findLoopBreakers func ex (Graph g ln kv fn) = ans where
+    -> Graph n     -- ^ the graph
+    ->  ([n],[n])  -- ^ (loop breakers,dependency ordered nodes after loopbreaking)
+findLoopBreakers func ex (Graph g ln) = ans where
hunk ./src/Util/Graph.hs 90
-            mv = case  sortBy (\ a b -> compare (snd b) (snd a)) [ (v,func (ln v)) | v <- ns, ex (ln v) ] of
+            mv = case  sortBy (\ a b -> compare (snd b) (snd a)) [ (v,func (ln!v)) | v <- ns, ex (ln!v) ] of
hunk ./src/Util/Graph.hs 96
-        f _ [] xs lb = (map (ln . head) (group $ sort lb),reverse $ map ln xs)
+        f _ [] xs lb = (map ((ln!) . head) (group $ sort lb),reverse $ map (ln!) xs)
hunk ./src/Util/Graph.hs 100
-sccGroups :: Graph n k -> [[n]]
+reachable :: Graph n -> [Vertex] -> [n]
+reachable (Graph g ln) vs = map (ln!) $ snub $  concatMap (G.reachable g) vs
+
+sccGroups :: Graph n -> [[n]]
hunk ./src/Util/Graph.hs 106
-scc :: Graph n k -> [Either n [n]]
-scc (Graph g ln kv fn) = map decode forest where
+scc :: Graph n -> [Either n [n]]
+scc (Graph g ln) = map decode forest where
hunk ./src/Util/Graph.hs 110
-        | v `elem` g ! v = Right [ln v]
-        | otherwise = Left (ln v)
+        | v `elem` g ! v = Right [ln!v]
+        | otherwise = Left (ln!v)
hunk ./src/Util/Graph.hs 113
-    dec (Node v ts) vs = ln v:foldr dec vs ts
+    dec (Node v ts) vs = ln!v:foldr dec vs ts
hunk ./src/Util/Graph.hs 115
-sccForest :: Graph n k -> Forest n
-sccForest (Graph g ln kv fn) = map (fmap ln) forest where
+sccForest :: Graph n -> Forest n
+sccForest (Graph g ln) = map (fmap (ln!)) forest where
hunk ./src/Util/Graph.hs 119
-dff :: Graph n k -> Forest n
-dff (Graph g ln kv fn) = map (fmap ln) forest where
+dff :: Graph n -> Forest n
+dff (Graph g ln) = map (fmap (ln!)) forest where
hunk ./src/Util/Graph.hs 123
-dfs :: Graph n k -> [k] -> Forest n
-dfs (Graph g ln kv fn) ks = map (fmap ln) forest where
-    forest = G.dfs g [ v | Just v <- map kv ks]
-
-components :: Graph n k -> [[n]]
-components (Graph g ln kv fn) = map decode forest where
+components :: Graph n -> [[n]]
+components (Graph g ln) = map decode forest where
hunk ./src/Util/Graph.hs 127
-    dec (Node v ts) vs = ln v:foldr dec vs ts
-
+    dec (Node v ts) vs = ln!v:foldr dec vs ts
hunk ./src/Util/Graph.hs 129
-reachable :: Graph n k -> [k] -> [n]
-reachable (Graph g ln kv _) ns = map ln $ snub $  concatMap (G.reachable g) gs where
-    gs = [ v | Just v <- map kv ns]
hunk ./src/Util/Graph.hs 130
-topSort :: Graph n k -> [n]
-topSort (Graph g ln _ _) = map ln $ G.topSort g
+topSort :: Graph n -> [n]
+topSort (Graph g ln) = map (ln!) $ G.topSort g
hunk ./src/Util/Graph.hs 133
-cyclicNodes :: Graph n k -> [n]
+cyclicNodes :: Graph n -> [n]
hunk ./src/Util/Graph.hs 136
+toDag :: Graph n -> Graph [n]
+toDag (Graph g lv) = Graph g' ns' where
+    ns' = listArray (0,max_v) [ map (lv!) ns |  ns <- nss ]
+    g' = listArray (0,max_v) [ snub [ v | n <- ns, v <- g!n ] | ns <- nss ]
+    max_v = length nss - 1
+    nss = map (flip f []) (G.scc g) where
+        f (Node v ts) rs = v:foldr f rs ts
+
+type AdjacencyMatrix s  = STArray s (Vertex,Vertex) Bool
+type IAdjacencyMatrix  = Array (Vertex,Vertex) Bool
+
+transitiveClosureAM :: AdjacencyMatrix s -> ST s ()
+transitiveClosureAM arr = do
+    bnds@(_,(max_v,_)) <- getBounds arr
+    forM_ [0 .. max_v] $ \k -> do
+        forM_ (range bnds) $ \ (i,j) -> do
+                dij <- readArray arr (i,j)
+                dik <- readArray arr (i,k)
+                dkj <- readArray arr (k,j)
+                writeArray arr (i,j) (dij || (dik && dkj))
+
+
+
+transitiveReductionAM :: AdjacencyMatrix s -> ST s ()
+transitiveReductionAM arr = do
+    bnds@(_,(max_v,_)) <- getBounds arr
+    transitiveClosureAM arr
+    (farr :: IAdjacencyMatrix) <- freeze arr
+    forM_ [0 .. max_v] $ \k -> do
+        forM_ (range bnds) $ \ (i,j) -> do
+            if farr!(k,i) && farr!(i,j) then
+                writeArray arr (k,j) False
+             else return ()
+
+toAdjacencyMatrix :: G.Graph -> ST s (AdjacencyMatrix s)
+toAdjacencyMatrix g = do
+    let (0,max_v) = bounds g
+    arr <- newArray ((0,0),(max_v,max_v)) False :: ST s (STArray s (Vertex,Vertex) Bool)
+    sequence_ [ writeArray arr (v,u) True | (v,vs) <- assocs g, u <- vs ]
+    return arr
+
+fromAdjacencyMatrix :: AdjacencyMatrix s -> ST s G.Graph
+fromAdjacencyMatrix arr = do
+    bnds@(_,(max_v,_)) <- getBounds arr
+    rs <- getAssocs arr
+    let rs' = [ x | (x,True) <- rs ]
+    return (listArray (0,max_v) [ [ v | (n',v) <- rs', n == n' ] | n <- [ 0 .. max_v] ])
+
+transitiveClosure :: Graph n -> Graph n
+transitiveClosure (Graph g ns) = let g' = runST (tc g) in (Graph g' ns) where
+    tc g = do
+        a <- toAdjacencyMatrix g
+        transitiveClosureAM a
+        fromAdjacencyMatrix a
+
+transitiveReduction :: Graph n -> Graph n
+transitiveReduction (Graph g ns) = let g' = runST (tc g) in (Graph g' ns) where
+    tc g = do
+        a <- toAdjacencyMatrix g
+        transitiveReductionAM a
+        fromAdjacencyMatrix a
+
hunk ./src/Util/Graph.hs 199
-transitiveClosure' ::  G.Graph -> G.Graph 
-transitiveClosure' g = array (bounds g) [ (i,G.reachable g i) | i <- vertices g]
+instance Functor Graph where
+    fmap f (Graph g n) = Graph g (fmap f n)
hunk ./src/Util/Graph.hs 202
-transitiveClosure :: Graph n k -> Graph n k
-transitiveClosure (Graph g x1 x2 x3) = Graph (transitiveClosure' g) x1 x2 x3
+--mapT    :: (Vertex -> a -> b) -> Table a -> Table b
+--mapT f t = listArray (bounds t) [ (f v (t!v)) | v <- indices t ]
hunk ./src/Util/Graph.hs 205
-mapT    :: (Vertex -> a -> b) -> Table a -> Table b
-mapT f t = array (bounds t) [ (,) v (f v (t!v)) | v <- indices t ]
+restitchGraph :: Ord k => (n -> k) -> (n -> [k]) -> Graph n -> Graph n
+restitchGraph fn fd (Graph g nr) = Graph g' nr where
+    kmap = Map.fromList [ (fn n,i) | (i,n) <- assocs nr ]
+    g'	 = listArray (bounds g) [mapMaybe (flip Map.lookup kmap) (snub $ fd n) | n <- elems nr]
hunk ./src/Util/Graph.hs 210
+mapGraph :: forall a b . (a -> [b] -> b) -> Graph a -> Graph b
+mapGraph f (Graph gr nr) = runST $ do
+    mnr <- thaw nr  :: ST s (STArray s Vertex a)
+    mnr <- mapArray Left mnr
+    let g i = readArray mnr i >>= \v -> case v of
+            Right m -> return m
+            Left l -> mdo
+                writeArray mnr i (Right r)
+                rs <- mapM g (gr!i)
+                let r = f l rs
+                return r
+    mapM_ g (range $ bounds nr)
+    mnr <- mapArray fromRight mnr
+    mnr <- unsafeFreeze mnr
+    return (Graph gr mnr)
hunk ./src/Util/Graph2.hs 1
--- | Data.Graph is sorely lacking in several ways, This just tries to fill in
--- some holes and provide a more convinient interface
-
-module Util.Graph2 where
-
-import Control.Monad
-import Control.Monad.ST
-import Data.Array.MArray
-import Data.Array.IArray
-import Data.Array.ST
-import Data.Graph hiding(Graph)
-import Data.Maybe
-import GenUtil
-import List(sort,sortBy,group,delete)
-import qualified Data.Graph as G
-import qualified Data.Map as Map
-
-
-data Graph n = Graph G.Graph (Table n)
-
-graphGraph (Graph x _) = x
-graphNodes (Graph _ y) = y
-
-instance Show n => Show (Graph n) where
-    showsPrec n g = showsPrec n (Util.Graph2.scc g)
-
-fromGraph :: Graph n -> [(n,[n])]
-fromGraph (Graph g lv) = [ (lv!v,map (lv!) vs) | (v,vs) <- assocs g ]
-
--- | Build a graph from a list of nodes uniquely identified by keys,
--- with a list of keys of nodes this node should have edges to.
--- The out-list may contain keys that don't correspond to
--- nodes of the graph; they are ignored.
-newGraph :: Ord k => [n] -> (n -> k) -> (n -> [k]) -> Graph n
-newGraph ns fn fd = Graph graph nr where
-    nr = listArray bounds0 ns
-    max_v      	    = length ns - 1
-    bounds0         = (0,max_v) :: (Vertex, Vertex)
-    kmap = Map.fromList [ (fn n,i) | (i,n) <- zip [0 ..] ns ]
-    graph	    = listArray bounds0 [mapMaybe (flip Map.lookup kmap) (snub $ fd n) | n <- ns]
-
-fromScc (Left n) = [n]
-fromScc (Right n) = n
-
--- | determine a set of loopbreakers subject to a fitness function
--- loopbreakers have a minimum of their  incoming edges ignored.
-findLoopBreakers
-    :: (n -> Int)  -- ^ fitness function, greater numbers mean more likely to be a loopbreaker
-    -> (n -> Bool) -- ^ whether a node is suitable at all for a choice as loopbreaker
-    -> Graph n     -- ^ the graph
-    ->  ([n],[n])  -- ^ (loop breakers,dependency ordered nodes after loopbreaking)
-findLoopBreakers func ex (Graph g ln) = ans where
-    scc = G.scc g
-    ans = f g scc [] [] where
-        f g (Node v []:sccs) fs lb
-            | v `elem` g ! v = let ng = (fmap (List.delete v) g) in  f ng (G.scc ng) [] (v:lb)
-            | otherwise = f g sccs (v:fs) lb
-
-        f g (n:_) fs lb = f ng (G.scc ng) [] (mv:lb) where
-            mv = case  sortBy (\ a b -> compare (snd b) (snd a)) [ (v,func (ln!v)) | v <- ns, ex (ln!v) ] of
-                ((mv,_):_) -> mv
-                [] -> error "findLoopBreakers: no valid loopbreakers"
-            ns = dec n []
-            ng = fmap (List.delete mv) g
-
-        f _ [] xs lb = (map ((ln!) . head) (group $ sort lb),reverse $ map (ln!) xs)
-    dec (Node v ts) vs = v:foldr dec vs ts
-
-
-sccGroups :: Graph n -> [[n]]
-sccGroups g = map fromScc (Util.Graph2.scc g)
-
-scc :: Graph n -> [Either n [n]]
-scc (Graph g ln) = map decode forest where
-    forest = G.scc g
-    decode (Node v [])
-        | v `elem` g ! v = Right [ln!v]
-        | otherwise = Left (ln!v)
-    decode other = Right (dec other [])
-    dec (Node v ts) vs = ln!v:foldr dec vs ts
-
-sccForest :: Graph n -> Forest n
-sccForest (Graph g ln) = map (fmap (ln!)) forest where
-    forest = G.scc g
-
-dff :: Graph n -> Forest n
-dff (Graph g ln) = map (fmap (ln!)) forest where
-    forest = G.dff g
-
-components :: Graph n -> [[n]]
-components (Graph g ln) = map decode forest where
-    forest = G.components g
-    decode n = dec n []
-    dec (Node v ts) vs = ln!v:foldr dec vs ts
-
-
-topSort :: Graph n -> [n]
-topSort (Graph g ln) = map (ln!) $ G.topSort g
-
-cyclicNodes :: Graph n -> [n]
-cyclicNodes g = concat [ xs | Right xs <- Util.Graph2.scc g]
-
-toDag :: Graph n -> Graph [n]
-toDag (Graph g lv) = Graph g' ns' where
-    ns' = listArray (0,max_v) [ map (lv!) ns |  ns <- nss ]
-    g' = listArray (0,max_v) [ snub [ v | n <- ns, v <- g!n ] | ns <- nss ]
-    max_v = length nss - 1
-    nss = map (flip f []) (G.scc g) where
-        f (Node v ts) rs = v:foldr f rs ts
-
-type AdjacencyMatrix s  = STArray s (Vertex,Vertex) Bool
-type IAdjacencyMatrix  = Array (Vertex,Vertex) Bool
-
-transitiveClosureAM :: AdjacencyMatrix s -> ST s ()
-transitiveClosureAM arr = do
-    bnds@(_,(max_v,_)) <- getBounds arr
-    forM_ [0 .. max_v] $ \k -> do
-        forM_ (range bnds) $ \ (i,j) -> do
-                dij <- readArray arr (i,j)
-                dik <- readArray arr (i,k)
-                dkj <- readArray arr (k,j)
-                writeArray arr (i,j) (dij || (dik && dkj))
-
-
-
-transitiveReductionAM :: AdjacencyMatrix s -> ST s ()
-transitiveReductionAM arr = do
-    bnds@(_,(max_v,_)) <- getBounds arr
-    transitiveClosureAM arr
-    (farr :: IAdjacencyMatrix) <- freeze arr
-    forM_ [0 .. max_v] $ \k -> do
-        forM_ (range bnds) $ \ (i,j) -> do
-            if farr!(k,i) && farr!(i,j) then
-                writeArray arr (k,j) False
-             else return ()
-
-toAdjacencyMatrix :: G.Graph -> ST s (AdjacencyMatrix s)
-toAdjacencyMatrix g = do
-    let (0,max_v) = bounds g
-    arr <- newArray ((0,0),(max_v,max_v)) False :: ST s (STArray s (Vertex,Vertex) Bool)
-    sequence_ [ writeArray arr (v,u) True | (v,vs) <- assocs g, u <- vs ]
-    return arr
-
-fromAdjacencyMatrix :: AdjacencyMatrix s -> ST s G.Graph
-fromAdjacencyMatrix arr = do
-    bnds@(_,(max_v,_)) <- getBounds arr
-    rs <- getAssocs arr
-    let rs' = [ x | (x,True) <- rs ]
-    return (listArray (0,max_v) [ [ v | (n',v) <- rs', n == n' ] | n <- [ 0 .. max_v] ])
-
-transitiveClosure :: Graph n -> Graph n
-transitiveClosure (Graph g ns) = let g' = runST (tc g) in (Graph g' ns) where
-    tc g = do
-        a <- toAdjacencyMatrix g
-        transitiveClosureAM a
-        fromAdjacencyMatrix a
-
-transitiveReduction :: Graph n -> Graph n
-transitiveReduction (Graph g ns) = let g' = runST (tc g) in (Graph g' ns) where
-    tc g = do
-        a <- toAdjacencyMatrix g
-        transitiveReductionAM a
-        fromAdjacencyMatrix a
-
---transitiveClosure' ::  G.Graph -> G.Graph
---transitiveClosure' g = array (bounds g) [ (i,G.reachable g i) | i <- vertices g]
-
---transitiveClosure :: Graph n -> Graph n
---transitiveClosure (Graph g x1) = Graph (transitiveClosure' g) x1
-
-
-instance Functor Graph where
-    fmap f (Graph g n) = Graph g (fmap f n)
-
-mapT    :: (Vertex -> a -> b) -> Table a -> Table b
-mapT f t = array (bounds t) [ (,) v (f v (t!v)) | v <- indices t ]
-
---mapGraph :: (Either a [a] -> [b] -> b) -> Graph a -> Graph b
-
-
rmfile ./src/Util/Graph2.hs
hunk ./src/data/names.txt 22
+#Int       Jhc.Prim.Int
+#Integer   Jhc.Basics.Integer
+#
+#Int8      Data.Int.Int8
+#Int16     Data.Int.Int16
+#Int32     Data.Int.Int32
+#Int64     Data.Int.Int64
+#IntMax    Data.Int.IntMax
+#IntPtr    Data.Int.IntPtr
+#
+#Word       Jhc.Prim.Word
+#Word8      Data.Word.Word8
+#Word16     Data.Word.Word16
+#Word32     Data.Word.Word32
+#Word64     Data.Word.Word64
+#WordMax    Data.Word.WordMax
+#WordPtr    Data.Word.WordPtr
hunk ./src/data/names.txt 58
+BitsSize   Jhc.Types.BitsSize_
+BitsWchar  Jhc.Types.BitsWchar_
hunk ./src/data/names.txt 74
+#Int        Int#
+#Integer    Integer#
hunk ./src/data/names.txt 97
-bits128         bits128
-bool            bool
-float32         fbits32
-float64         fbits64
-float80         fbits80
-float128        fbits128
-#bits_short_     bits<short>
-#bits_int_       bits<int>
-#bits_long_      bits<long>
+
+bits8         bits8
+bits16        bits16
+bits32        bits32
+bits64        bits64
+bits128       bits128
+bool          bool
+float32       fbits32
+float64       fbits64
+float80       fbits80
+float128      fbits128
+bits_short_   bits<short>
+bits_int_     bits<int>
+bits_long_    bits<long>
+bits_wchar_t_ bits<wchar_t>
+bits_max_     bits<max>
+bits_ptr_     bits<ptr>
+bits_size_t_  bits<size_t>
+bits_time_t_  bits<time_t>
hunk ./src/data/primitives.txt 38
-Foreign.C.Types.CWchar, ubits32, int, 0x10FFFF, 0
-Foreign.C.Types.CWint, sbits32, int, 0x10FFFF, 0
+Foreign.C.Types.CWchar, ubits<wchar_t>, int, 0x10FFFF, 0
+Foreign.C.Types.CWint, sbits<wchar_t>, int, 0x10FFFF, 0
hunk ./utils/op_names.prl 51
-foreach my $ort (sort keys %rt) {
-    my $rt = $ort;
-    $rt =~ s/[ <>]/_/g;
-    print "{-# NOINLINE rt_$rt #-}\n";
-    print "rt_$rt = toName RawType \"$ort\"\n";
-
-}
+#foreach my $ort (sort keys %rt) {
+#    my $rt = $ort;
+#    $rt =~ s/[ <>]/_/g;
+#    print "{-# NOINLINE rt_$rt #-}\n";
+#    print "rt_$rt = toName RawType \"$ort\"\n";
+#
+#}