excludeEdges :: Input a => [EdgeId] -> StGNG a ()
excludeEdges eids = do
    deades <- excludeEdges'
    mapM deleteEdgeFromNodes deades
    deleteIsolatedNodes
  where
    excludeEdges' = do
        gng <- State.get
        let es = gng^.edges
        let deades = filter (\e -> e^.age > gng^.settings^.ageMax)
                $ getAll es eids
        let deadids = map (^.edgeId) deades
        deleteEdges deadids
        return deades
    deleteIsolatedNodes = do
        deadids <- State.gets (Map.keys . Map.filter (\n -> n^.edgeIds == []) . (^.nodes))
        deleteNodes deadids
excludeEdges :: Input a => [EdgeId] -> StGNG a ()
excludeEdges eids = do
    deades <- excludeEdges'
    mapM deleteEdgeFromNodes deades
    deleteIsolatedNodes
  where
    excludeEdges' = do
        gng <- State.get
        let es = gng^.edges
        let deades = filter (\e -> e^.age > gng^.settings^.ageMax)
                $ getAll es eids
        let deadids = map (^.edgeId) deades
        deleteEdges deadids
        return deades
    deleteIsolatedNodes = do
        deadids <- State.gets (Map.keys . Map.filter (\n -> n^.edgeIds == []) . (^.nodes))
        deleteNodes deadids
excludeEdges eids = do
    deades <- excludeEdges'
    mapM deleteEdgeFromNodes deades
    deleteIsolatedNodes
  where
    excludeEdges' = do
        gng <- State.get
        let es = gng^.edges
        let deades = filter (\e -> e^.age > gng^.settings^.ageMax)
                $ getAll es eids
        let deadids = map (^.edgeId) deades
        deleteEdges deadids
        return deades
    deleteIsolatedNodes = do
        deadids <- State.gets (Map.keys . Map.filter (\n -> n^.edgeIds == []) . (^.nodes))
        deleteNodes deadids