on master help sign in
Add waitFor directive
commit70fa0c2ff1b50ec905d96b6bfb66546b354b1c01 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateFri 7 Jan 2011, 10:14 (16 years ago) parent664648c
1 file changed+7−1
src/Hakyll/Core/Compiler.hs+7−1
src/Hakyll/Core/Compiler.hs+7−1
@@ -7,6 +7,7 @@ module Hakyll.Core.Compiler
77 , getIdentifier
88 , getRoute
99 , getResourceString
10+ , waitFor
1011 , require
1112 , requireAll
1213 , cached
@@ -82,6 +83,11 @@ getDependency identifier = CompilerM $ do
8283 ++ show identifier
8384 ++ " not found in the cache, the cache might be corrupted"
8485
86+-- | Wait until another compiler has finished before running this compiler
87+--
88+waitFor :: Identifier -> Compiler a a
89+waitFor = fromDependencies . const . return
90+
8591-- | Require another target. Using this function ensures automatic handling of
8692-- dependencies
8793--
@@ -90,7 +96,7 @@ require :: (Binary a, Typeable a, Writable a)
9096 -> (b -> a -> c)
9197 -> Compiler b c
9298require identifier f =
93− fromDependencies (const [identifier]) >>> fromJob require'
99+ waitFor identifier >>> fromJob require'
94100 where
95101 require' x = do
96102 y <- getDependency identifier