From a337e38c0b059ec9a174e93f099a57e086a82b61 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Wed, 17 Dec 2014 22:29:19 +1100 Subject: Bugfix for nodesOut, edgesOut, edgesIn --- src/Grasp/Monad.hs | 15 ++++++--------- 1 file 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 -- cgit