import Prelude if haddocking
+#ifdef __HADDOCK__
+import Prelude
+#endif
+
#ifdef COMPILING_GHC
IMP_Ubiq(){-uitous-}
# ifdef DEBUG
#ifdef COMPILING_GHC
IMP_Ubiq(){-uitous-}
# ifdef DEBUG
- -- back, cross, forward,
+ -- tree, back, cross, forward,
reachable, path,
module Data.Tree
reachable, path,
module Data.Tree
import Data.Array
import Data.List
import Data.Array
import Data.List
+#ifdef __HADDOCK__
+import Prelude
+#endif
+
-------------------------------------------------------------------------
-- -
-- External interface
-------------------------------------------------------------------------
-- -
-- External interface
-- Algorithm 5: Classifying edges
------------------------------------------------------------
-- 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 ]
back :: Graph -> Table Int -> Graph
back g post = mapT select g
where select v ws = [ w | w <- ws, post!v < post!w ]
+#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__
-- | 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__