X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=scratch%2FGraph.hs;h=5bb4e96955fdd44c7da3a2b2f97e27082465534d;hb=fc8f7aac8680ef294f47b72d44bddc674cf0fa42;hp=c9a9f14939ff04869f882739868533fbe2436a5b;hpb=22d68f8f5c4abc1cd1e29a65a01be0a9d38f5296;p=mate.git diff --git a/scratch/Graph.hs b/scratch/Graph.hs index c9a9f14..5bb4e96 100644 --- a/scratch/Graph.hs +++ b/scratch/Graph.hs @@ -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