From ef81889c1eccb08acc27d47c9df652541134e3db Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 6 Mar 2014 18:17:15 +1100 Subject: Getting remote and local repos sync'd --- Library/GraphPart.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Library/GraphPart.hs') diff --git a/Library/GraphPart.hs b/Library/GraphPart.hs index 97503eb..02a95c0 100644 --- a/Library/GraphPart.hs +++ b/Library/GraphPart.hs @@ -80,8 +80,8 @@ outputLab gpart = do -graphAdd :: GraphPart -> Maybe (Node,Int) -> [(Node,Int)] -> PGraph -> PGraph -graphAdd gpart i o graph = +graphAddImp :: GraphPart -> Maybe (Node,Int) -> [(Node,Int)] -> PGraph -> PGraph +graphAddImp gpart i o graph = let (resolved, dict) = resolveNodeClash graph (getGraph gpart) base = (Graph.insEdges (Graph.labEdges resolved)) . (Graph.insNodes (Graph.labNodes resolved)) $ graph @@ -98,14 +98,21 @@ graphAdd gpart i o graph = in Graph.insEdges outEdge inputAdded graph' = outputAdded + in graph' + + +graphAdd :: GraphPart -> Maybe (Node,Int) -> [(Node,Int)] -> PGraph -> PGraph +graphAdd gpart i o graph = + let graph' = graphAddImp gpart i o graph in checkDupe graph' graphAddList :: [(GraphPart, Maybe (Node,Int), [(Node,Int)])] -> PGraph -> PGraph graphAddList partList graph = - foldl' (\g (x,y,z) -> graphAdd x y z g) graph partList + let graph' = foldl' (\g (x,y,z) -> graphAddImp x y z g) graph partList + in checkDupe graph' -- cgit