X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FDigraph.lhs;h=2ed39332c65932111a1f20f532f1dac9b66fd2ae;hb=a50e111f46a16529fe5f8d481919044c8aceea05;hp=eadabdae7d1d53e8636735bed97268760e13bf6f;hpb=f9cde00b2e1a078e433af81bf9021a96cc613976;p=ghc-hetmet.git diff --git a/compiler/utils/Digraph.lhs b/compiler/utils/Digraph.lhs index eadabda..2ed3933 100644 --- a/compiler/utils/Digraph.lhs +++ b/compiler/utils/Digraph.lhs @@ -40,6 +40,7 @@ module Digraph( import Util ( sortLe ) import Outputable import Maybes ( expectJust ) +import MonadUtils ( allM ) -- Extensions import Control.Monad ( filterM, liftM, liftM2 ) @@ -75,7 +76,7 @@ Note [Nodes, keys, vertices] \begin{code} data Graph node = Graph { - gr_int_graph :: IntGraph, + gr_int_graph :: IntGraph, gr_vertex_to_node :: Vertex -> node, gr_node_to_vertex :: node -> Maybe Vertex } @@ -588,8 +589,4 @@ vertexGroupsS provided g to_provide vertexReady :: Set s -> IntGraph -> Vertex -> ST s Bool vertexReady provided g v = liftM2 (&&) (liftM not $ provided `contains` v) (allM (provided `contains`) (g!v)) - -allM :: Monad m => (a -> m Bool) -> [a] -> m Bool -allM _ [] = return True -allM f (b:bs) = (f b) >>= (\bv -> if bv then allM f bs else return False) \end{code}