projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do-notation in an arrow context is not rebindable
[ghc-hetmet.git]
/
compiler
/
utils
/
Digraph.lhs
diff --git
a/compiler/utils/Digraph.lhs
b/compiler/utils/Digraph.lhs
index
eadabda
..
a341bde
100644
(file)
--- 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 Util ( sortLe )
import Outputable
import Maybes ( expectJust )
+import MonadUtils ( allM )
-- Extensions
import Control.Monad ( filterM, liftM, liftM2 )
-- Extensions
import Control.Monad ( filterM, liftM, liftM2 )
@@
-49,12
+50,7
@@
import Control.Monad.ST
import Data.Maybe
import Data.Array
import Data.List ( (\\) )
import Data.Maybe
import Data.Array
import Data.List ( (\\) )
-
-#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ > 604
import Data.Array.ST
import Data.Array.ST
-#else
-import Data.Array.ST hiding ( indices, bounds )
-#endif
\end{code}
%************************************************************************
\end{code}
%************************************************************************
@@
-75,7
+71,7
@@
Note [Nodes, keys, vertices]
\begin{code}
data Graph node = Graph {
\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
}
gr_vertex_to_node :: Vertex -> node,
gr_node_to_vertex :: node -> Maybe Vertex
}
@@
-588,8
+584,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))
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}
\end{code}