Commit f127e585 authored by Guido Trotter's avatar Guido Trotter
Browse files

remove duplicate code in Graph.hs



Also update the docstring of a function.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent d6b5da24
......@@ -138,10 +138,10 @@ isColorable g = isUndirected g && not (hasLoop g)
verticesColors :: VertColorMap -> [Graph.Vertex] -> [Color]
verticesColors cMap = mapMaybe (`IntMap.lookup` cMap)
-- | Get the colors of a list of vertices.
-- | Get the set of colors of a list of vertices.
-- Any uncolored vertices are ignored.
verticesColorSet :: VertColorMap -> [Graph.Vertex] -> IntSet.IntSet
verticesColorSet cMap = IntSet.fromList . mapMaybe (`IntMap.lookup` cMap)
verticesColorSet cMap = IntSet.fromList . verticesColors cMap
-- | Get the colors of the neighbors of a vertex.
neighColors :: Graph.Graph -> VertColorMap -> Graph.Vertex -> [Color]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment