From: ross Date: Thu, 6 Nov 2003 12:50:24 +0000 (+0000) Subject: [project @ 2003-11-06 12:50:22 by ross] X-Git-Tag: nhc98-1-18-release~450 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=715c78df1e7cdd474926cd919f4193fa9d23ab5e;p=ghc-base.git [project @ 2003-11-06 12:50:22 by ross] import Prelude if haddocking --- diff --git a/Data/FiniteMap.hs b/Data/FiniteMap.hs index f1db267..0b29bb3 100644 --- a/Data/FiniteMap.hs +++ b/Data/FiniteMap.hs @@ -89,6 +89,10 @@ import Data.Maybe ( isJust ) import GHC.Base #endif +#ifdef __HADDOCK__ +import Prelude +#endif + #ifdef COMPILING_GHC IMP_Ubiq(){-uitous-} # ifdef DEBUG diff --git a/Data/Graph.hs b/Data/Graph.hs index 12b3a01..4205964 100644 --- a/Data/Graph.hs +++ b/Data/Graph.hs @@ -43,7 +43,7 @@ module Data.Graph( components, scc, bcc, - -- back, cross, forward, + -- tree, back, cross, forward, reachable, path, module Data.Tree @@ -60,6 +60,10 @@ import Data.Maybe import Data.Array import Data.List +#ifdef __HADDOCK__ +import Prelude +#endif + ------------------------------------------------------------------------- -- - -- External interface @@ -321,6 +325,10 @@ scc g = dfs g (reverse (postOrd (transposeG g))) -- Algorithm 5: Classifying edges ------------------------------------------------------------ +tree :: Bounds -> Forest Vertex -> Graph +tree bnds ts = buildG bnds (concat (map flat ts)) + where flat (Node v ts) = [ (v, w) | Node w _us <- ts ] ++ concat (map flat ts) + back :: Graph -> Table Int -> Graph back g post = mapT select g where select v ws = [ w | w <- ws, post!v < post!w ] diff --git a/Data/Tree.hs b/Data/Tree.hs index 8524935..2ba7b1a 100644 --- a/Data/Tree.hs +++ b/Data/Tree.hs @@ -18,6 +18,10 @@ module Data.Tree( flatten, levels, ) where +#ifdef __HADDOCK__ +import Prelude +#endif + -- | Multi-way trees, also known as /rose trees/. data Tree a = Node a (Forest a) -- ^ a value and zero or more child trees. #ifndef __HADDOCK__