diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-03-06 18:17:15 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-03-06 18:17:15 +1100 |
commit | ef81889c1eccb08acc27d47c9df652541134e3db (patch) | |
tree | ce3d1350cf8ad5256b8cb94a0ce6f6df5dce61c3 /Library/GraphPart.hs | |
parent | 93dcd8b68c0b9d3ecb5cb2352b11c3a9b362f1d9 (diff) |
Getting remote and local repos sync'd
Diffstat (limited to 'Library/GraphPart.hs')
-rw-r--r-- | Library/GraphPart.hs | 13 |
1 files changed, 10 insertions, 3 deletions
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' |