diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-12-17 22:29:19 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-12-17 22:29:19 +1100 |
commit | a337e38c0b059ec9a174e93f099a57e086a82b61 (patch) | |
tree | 7a14f2ce06d86dcc8385761a7e98e633e94a5d25 | |
parent | 1f0a57c5890ec539d5f17255fe413004c94abe44 (diff) |
Bugfix for nodesOut, edgesOut, edgesIn
-rw-r--r-- | src/Grasp/Monad.hs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/Grasp/Monad.hs b/src/Grasp/Monad.hs index e35cc34..a79cb20 100644 --- a/src/Grasp/Monad.hs +++ b/src/Grasp/Monad.hs @@ -309,37 +309,34 @@ nextIP = do nodesOut :: EdgeLabel -> GNode -> GraspM [GNode] nodesOut s n = do (gr, ips, fh) <- State.get - curNode <- peekIP - let nout = Graph.lsuc gr (GN.toNode (Maybe.fromJust curNode)) + let nout = Graph.lsuc gr (GN.toNode n) filtered = filter ((== s) . snd) nout result = map (\(x,y) -> GN.mk (x, Maybe.fromJust (Graph.lab gr x))) filtered - if (Maybe.isNothing curNode) then return [] else return result + return result edgesOut :: GNode -> GraspM [GEdge] edgesOut n = do (gr, ips, fh) <- State.get - curNode <- peekIP - let eout = Graph.out gr (GN.toNode (Maybe.fromJust curNode)) + let eout = Graph.out gr (GN.toNode n) result = map GE.mk eout - if (Maybe.isNothing curNode) then return [] else return result + return result edgesIn :: GNode -> GraspM [GEdge] edgesIn n = do (gr, ips, fh) <- State.get - curNode <- peekIP - let ein = Graph.inn gr (GN.toNode (Maybe.fromJust curNode)) + let ein = Graph.inn gr (GN.toNode n) result = map GE.mk ein - if (Maybe.isNothing curNode) then return [] else return result + return result |