1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Define a Vertex datatype.

This commit is contained in:
Rob Rix 2018-04-02 18:08:02 -04:00
parent 3e991e8309
commit 9186742ba1

View File

@ -25,6 +25,12 @@ import Prologue hiding (empty, packageName)
newtype ImportGraph = ImportGraph { unImportGraph :: G.Graph Name }
deriving (Eq, Graph, Show)
data Vertex
= Package PackageName
| Module ModuleName
| Variable Name
deriving (Eq, Ord, Show)
-- | Render a 'ImportGraph' to a 'ByteString' in DOT notation.
renderImportGraph :: ImportGraph -> ByteString
renderImportGraph = export (defaultStyle friendlyName) . unImportGraph