Permalink
Browse files

Add a .Internal module that exports the representation of Graph

  • Loading branch information...
batterseapower committed Mar 8, 2011
1 parent 355c148 commit 6b3add24c998c01d4f646694920abc96edb44253
Showing with 22 additions and 7 deletions.
  1. +2 −7 Data/Graph/Wrapper.hs
  2. +19 −0 Data/Graph/Wrapper/Internal.hs
  3. +1 −0 graph-wrapper.cabal
View
@@ -30,6 +30,8 @@ module Data.Graph.Wrapper (
SCC(..), stronglyConnectedComponents, sccGraph
) where
+import Data.Graph.Wrapper.Internal
+
import Control.Arrow (second)
import Control.Monad
import Control.Monad.ST
@@ -70,13 +72,6 @@ amapWithKeyM f arr = liftM (array (bounds arr)) $ mapM (\(i, v) -> liftM (\v' ->
-- | An edge from the first vertex to the second
type Edge i = (i, i)
--- | A directed graph
-data Graph i v = G {
- graph :: G.Graph,
- indexGVertexArray :: Array G.Vertex i,
- gVertexVertexArray :: Array G.Vertex v
- }
-
instance (Ord i, Show i, Show v) => Show (Graph i v) where
show g = "fromVerticesEdges " ++ show ([(i, vertex g i) | i <- vertices g]) ++ " " ++ show (edges g)
@@ -0,0 +1,19 @@
+-- | Exposes things that are considered to be too unstable for inclusion in the exports of "Data.Graph.Wrapper".
+--
+-- Use of this module should be avoided as it will change frequently and changes to this module alone will not necessarily
+-- follow the Package Versioning Policy.
+{-# OPTIONS_HADDOCK not-home #-}
+module Data.Graph.Wrapper.Internal (
+ Graph(..)
+ ) where
+
+import Data.Array
+import qualified Data.Graph as G
+
+-- | A directed graph
+data Graph i v = G {
+ graph :: G.Graph,
+ indexGVertexArray :: Array G.Vertex i,
+ gVertexVertexArray :: Array G.Vertex v
+ }
+
View
@@ -12,6 +12,7 @@ Category: Data Structures, Graphs
Library
Exposed-Modules: Data.Graph.Wrapper
+ Data.Graph.Wrapper.Internal
Build-Depends: base >= 3.0 && < 5.0,
array >= 0.3 && < 0.4,

0 comments on commit 6b3add2

Please sign in to comment.