on master help sign in
Relax Rules to RulesM a in most places
6bb94acJasper Van der Jeugt
src/Hakyll/Core/Rules/Internal.hs+1−1
@@ -80,7 +80,7 @@ type Rules = RulesM ()
80
80
81-- | Run a Rules monad, resulting in a 'RuleSet'
81-- | Run a Rules monad, resulting in a 'RuleSet'
82--
82--
83−runRules :: Rules -> ResourceProvider -> RuleSet
83+runRules :: RulesM a -> ResourceProvider -> RuleSet
84runRules rules provider = nubCompilers $
84runRules rules provider = nubCompilers $
85 evalState (execWriterT $ runReaderT (unRulesM rules) env) state
85 evalState (execWriterT $ runReaderT (unRulesM rules) env) state
86 where
86 where
src/Hakyll/Core/Run.hs+1−1
@@ -35,7 +35,7 @@ import Hakyll.Core.Logger
35
35
36-- | Run all rules needed, return the rule set used
36-- | Run all rules needed, return the rule set used
37--
37--
38−run :: HakyllConfiguration -> Rules -> IO RuleSet
38+run :: HakyllConfiguration -> RulesM a -> IO RuleSet
39run configuration rules = do
39run configuration rules = do
40 logger <- makeLogger putStrLn
40 logger <- makeLogger putStrLn
41
41
src/Hakyll/Main.hs+5−5
@@ -22,13 +22,13 @@ import Hakyll.Web.Preview.Server
22
22
23-- | This usualy is the function with which the user runs the hakyll compiler
23-- | This usualy is the function with which the user runs the hakyll compiler
24--
24--
25−hakyll :: Rules -> IO ()
25+hakyll :: RulesM a -> IO ()
26hakyll = hakyllWith defaultHakyllConfiguration
26hakyll = hakyllWith defaultHakyllConfiguration
27
27
28-- | A variant of 'hakyll' which allows the user to specify a custom
28-- | A variant of 'hakyll' which allows the user to specify a custom
29-- configuration
29-- configuration
30--
30--
31−hakyllWith :: HakyllConfiguration -> Rules -> IO ()
31+hakyllWith :: HakyllConfiguration -> RulesM a -> IO ()
32hakyllWith conf rules = do
32hakyllWith conf rules = do
33 args <- getArgs
33 args <- getArgs
34 case args of
34 case args of
@@ -44,7 +44,7 @@ hakyllWith conf rules = do
44
44
45-- | Build the site
45-- | Build the site
46--
46--
47−build :: HakyllConfiguration -> Rules -> IO ()
47+build :: HakyllConfiguration -> RulesM a -> IO ()
48build conf rules = do
48build conf rules = do
49 _ <- run conf rules
49 _ <- run conf rules
50 return ()
50 return ()
@@ -84,7 +84,7 @@ help = do
84
84
85-- | Preview the site
85-- | Preview the site
86--
86--
87−preview :: HakyllConfiguration -> Rules -> Int -> IO ()
87+preview :: HakyllConfiguration -> RulesM a -> Int -> IO ()
88preview conf rules port = do
88preview conf rules port = do
89 -- Fork a thread polling for changes
89 -- Fork a thread polling for changes
90 _ <- forkIO $ previewPoll conf update
90 _ <- forkIO $ previewPoll conf update
@@ -96,7 +96,7 @@ preview conf rules port = do
96
96
97-- | Rebuild the site
97-- | Rebuild the site
98--
98--
99−rebuild :: HakyllConfiguration -> Rules -> IO ()
99+rebuild :: HakyllConfiguration -> RulesM a -> IO ()
100rebuild conf rules = do
100rebuild conf rules = do
101 clean conf
101 clean conf
102 build conf rules
102 build conf rules