diff options
| author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-19 15:52:51 +0100 |
|---|---|---|
| committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-19 15:52:51 +0100 |
| commit | b1f70c339e031c1f6abf04ff63566f2cb9757a07 (patch) | |
| tree | aa47c4720f03d91537a26cd88981da41606c3fad /src/Hakyll/Core/DirectedGraph | |
| parent | 802742cdbed1bb0afa022e072621e621d21158f6 (diff) | |
| download | hakyll-b1f70c339e031c1f6abf04ff63566f2cb9757a07.tar.gz | |
Support old directory versions...
Diffstat (limited to 'src/Hakyll/Core/DirectedGraph')
| -rw-r--r-- | src/Hakyll/Core/DirectedGraph/Dot.hs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/Hakyll/Core/DirectedGraph/Dot.hs b/src/Hakyll/Core/DirectedGraph/Dot.hs deleted file mode 100644 index 06198e4..0000000 --- a/src/Hakyll/Core/DirectedGraph/Dot.hs +++ /dev/null @@ -1,36 +0,0 @@ --------------------------------------------------------------------------------- --- | Dump a directed graph in dot format. Used for debugging purposes -module Hakyll.Core.DirectedGraph.Dot - ( toDot - , writeDot - ) where - - --------------------------------------------------------------------------------- -import qualified Data.Set as S -import Hakyll.Core.DirectedGraph - - --------------------------------------------------------------------------------- --- | Convert a directed graph into dot format for debugging purposes -toDot :: Ord a - => (a -> String) -- ^ Convert nodes to dot names - -> DirectedGraph a -- ^ Graph to dump - -> String -- ^ Resulting string -toDot showTag graph = unlines $ concat - [ return "digraph dependencies {" - , map showNode (S.toList $ nodes graph) - , concatMap showEdges (S.toList $ nodes graph) - , return "}" - ] - where - showNode node = " \"" ++ showTag node ++ "\";" - showEdges node = map (showEdge node) $ neighbours node graph - showEdge x y = " \"" ++ showTag x ++ "\" -> \"" ++ showTag y ++ "\";" - - --------------------------------------------------------------------------------- --- | Write out the @.dot@ file to a given file path. See 'toDot' for more --- information. -writeDot :: Ord a => FilePath -> (a -> String) -> DirectedGraph a -> IO () -writeDot path showTag = writeFile path . toDot showTag |
