Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a .Internal module that exports the representation of Graph

  • Loading branch information...
commit 6b3add24c998c01d4f646694920abc96edb44253 1 parent 355c148
@batterseapower authored
View
9 Data/Graph/Wrapper.hs
@@ -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)
View
19 Data/Graph/Wrapper/Internal.hs
@@ -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
1  graph-wrapper.cabal
@@ -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,
Please sign in to comment.
Something went wrong with that request. Please try again.