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.hs6
-rw-r--r--src/Hakyll/Core/DirectedGraph/Internal.hs4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Hakyll/Core/DirectedGraph/DependencySolver.hs b/src/Hakyll/Core/DirectedGraph/DependencySolver.hs
index 214211b..54826ff 100644
--- a/src/Hakyll/Core/DirectedGraph/DependencySolver.hs
+++ b/src/Hakyll/Core/DirectedGraph/DependencySolver.hs
@@ -10,7 +10,7 @@ module Hakyll.Core.DirectedGraph.DependencySolver
import Prelude
import qualified Prelude as P
import Data.Set (Set)
-import Data.Maybe (catMaybes)
+import Data.Maybe (mapMaybe)
import qualified Data.Map as M
import qualified Data.Set as S
@@ -48,7 +48,7 @@ order temp stack set graph@(DirectedGraph graph')
-- Check which dependencies are still in the graph
let tag = nodeTag node
deps = S.toList $ nodeNeighbours node
- unsatisfied = catMaybes $ map (flip M.lookup graph') deps
+ unsatisfied = mapMaybe (`M.lookup` graph') deps
in case unsatisfied of
-- All dependencies for node are satisfied, we can return it and
@@ -58,7 +58,7 @@ order temp stack set graph@(DirectedGraph graph')
-- There is at least one dependency left. We need to solve that
-- one first...
- (dep : _) -> if (nodeTag dep) `S.member` set
+ (dep : _) -> if nodeTag dep `S.member` set
-- The dependency is already in our stack - cycle detected!
then cycleError
-- Continue with the dependency
diff --git a/src/Hakyll/Core/DirectedGraph/Internal.hs b/src/Hakyll/Core/DirectedGraph/Internal.hs
index bc9cd92..5b02ad6 100644
--- a/src/Hakyll/Core/DirectedGraph/Internal.hs
+++ b/src/Hakyll/Core/DirectedGraph/Internal.hs
@@ -16,8 +16,8 @@ import qualified Data.Set as S
-- | A node in the directed graph
--
data Node a = Node
- { nodeTag :: a -- ^ Tag identifying the node
- , nodeNeighbours :: (Set a) -- ^ Edges starting at this node
+ { nodeTag :: a -- ^ Tag identifying the node
+ , nodeNeighbours :: Set a -- ^ Edges starting at this node
} deriving (Show)
-- | Append two nodes. Useful for joining graphs.