summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/DirectedGraph
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core/DirectedGraph')
-rw-r--r--src/Hakyll/Core/DirectedGraph/DependencySolver.hs3
-rw-r--r--src/Hakyll/Core/DirectedGraph/ObsoleteFilter.hs6
2 files changed, 4 insertions, 5 deletions
diff --git a/src/Hakyll/Core/DirectedGraph/DependencySolver.hs b/src/Hakyll/Core/DirectedGraph/DependencySolver.hs
index dce59e0..17a4b69 100644
--- a/src/Hakyll/Core/DirectedGraph/DependencySolver.hs
+++ b/src/Hakyll/Core/DirectedGraph/DependencySolver.hs
@@ -15,7 +15,6 @@ import qualified Data.Map as M
import qualified Data.Set as S
import Hakyll.Core.DirectedGraph
-import qualified Hakyll.Core.DirectedGraph as DG
import Hakyll.Core.DirectedGraph.Internal
-- | Solve a dependency graph. This function returns an order to run the
@@ -55,7 +54,7 @@ order temp stack set graph@(DirectedGraph graph')
-- All dependencies for node are satisfied, we can return it and
-- remove it from the graph
[] -> order (tag : temp) stackTail (S.delete tag set)
- (DG.filter (== tag) graph)
+ (DirectedGraph $ M.delete tag graph')
-- There is at least one dependency left. We need to solve that
-- one first...
diff --git a/src/Hakyll/Core/DirectedGraph/ObsoleteFilter.hs b/src/Hakyll/Core/DirectedGraph/ObsoleteFilter.hs
index a3bc57a..f781819 100644
--- a/src/Hakyll/Core/DirectedGraph/ObsoleteFilter.hs
+++ b/src/Hakyll/Core/DirectedGraph/ObsoleteFilter.hs
@@ -4,7 +4,7 @@
-- obsolete nodes.
--
module Hakyll.Core.DirectedGraph.ObsoleteFilter
- ( obsoleteFilter
+ ( filterObsolete
) where
import qualified Data.Set as S
@@ -15,11 +15,11 @@ import qualified Hakyll.Core.DirectedGraph as DG
-- | Given a list of obsolete items, filter the dependency graph so it only
-- contains these items
--
-obsoleteFilter :: Ord a
+filterObsolete :: Ord a
=> [a] -- ^ List of obsolete items
-> DirectedGraph a -- ^ Dependency graph
-> DirectedGraph a -- ^ Resulting dependency graph
-obsoleteFilter obsolete graph =
+filterObsolete obsolete graph =
let reversed = DG.reverse graph
allObsolete = S.unions $ map (flip reachableNodes reversed) obsolete
in DG.filter (`S.member` allObsolete) graph