Mate: exposed internal functions of BasicBlocks for external benchmarks
[mate.git] / scratch / Graph.hs
index c9a9f14939ff04869f882739868533fbe2436a5b..5bb4e96955fdd44c7da3a2b2f97e27082465534d 100644 (file)
@@ -55,7 +55,7 @@ packNodes []       e = Leaf e        -- leaf
 
 -- Generates a cyclic datastructure given edges and nodes
 -- TODO: remove lists with maps in inputs
-toG :: (Ord k) => ([r] -> a -> r) -> [(k,[k])] -> k -> [(k, a)] -> Maybe r
+toG :: (Ord k,Show k) => ([r] -> a -> r) -> [(k,[k])] -> k -> [(k, a)] -> Maybe r
 toG g xs start pls = let nodeTable = M.fromList pls
                          payload s = case M.lookup s nodeTable of
                                        Just x  -> x
@@ -69,7 +69,8 @@ toG g xs start pls = let nodeTable = M.fromList pls
 
                          node f p t = case M.lookup t conn of
                                             (Just x) -> x
-                                            Nothing  -> error "illformed edge/node list in toG"
+                                            Nothing  
+                                              -> error $ "illformed edge/node list in toG" ++ (show t)
                    in M.lookup start conn