summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/DirectedGraph.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-08 22:17:04 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-08 22:17:04 +0200
commita8accd36b117c0a8cadb8dc5161c5a60d62a0aeb (patch)
treeea8475006c8a18d068e8e3896ca9fe8affa6ae43 /src/Hakyll/Core/DirectedGraph.hs
parente4545f9c9e0d94ebbba3532deab1fbdc9fbe70d1 (diff)
downloadhakyll-a8accd36b117c0a8cadb8dc5161c5a60d62a0aeb.tar.gz
Minor refactoring
Diffstat (limited to 'src/Hakyll/Core/DirectedGraph.hs')
-rw-r--r--src/Hakyll/Core/DirectedGraph.hs15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/Hakyll/Core/DirectedGraph.hs b/src/Hakyll/Core/DirectedGraph.hs
index 6be5c5c..ff9121a 100644
--- a/src/Hakyll/Core/DirectedGraph.hs
+++ b/src/Hakyll/Core/DirectedGraph.hs
@@ -10,7 +10,6 @@ module Hakyll.Core.DirectedGraph
, neighbours
, reverse
, reachableNodes
- , sanitize
) where
import Prelude hiding (reverse)
@@ -77,17 +76,9 @@ reachableNodes set graph = reachable (setNeighbours set) set
where
reachable next visited
| S.null next = visited
- | otherwise = reachable (sanitize' neighbours') (next `S.union` visited)
+ | otherwise = reachable (sanitize neighbours') (next `S.union` visited)
where
- sanitize' = S.filter (`S.notMember` visited)
- neighbours' = setNeighbours (sanitize' next)
+ sanitize = S.filter (`S.notMember` visited)
+ neighbours' = setNeighbours (sanitize next)
setNeighbours = S.unions . map (`neighbours` graph) . S.toList
-
--- | Remove all dangling pointers, i.e. references to notes that do
--- not actually exist in the graph.
---
-sanitize :: Ord a => DirectedGraph a -> DirectedGraph a
-sanitize (DirectedGraph graph) = DirectedGraph $ M.map sanitize' graph
- where
- sanitize' (Node t n) = Node t $ S.filter (`M.member` graph) n