@@ -1,10 +1,9 @@
11--------------------------------------------------------------------------------
2−-- | Internal rules module for types which are not exposed to the user
32{-# LANGUAGE GeneralizedNewtypeDeriving #-}
43{-# LANGUAGE Rank2Types #-}
54module Hakyll.Core.Rules.Internal
65 ( RuleSet (..)
7− , RuleEnvironment (..)
6+ , RulesRead (..)
87 , Rules (..)
98 , runRules
109 ) where
@@ -31,11 +30,10 @@ import Hakyll.Core.Routes
3130
3231
3332--------------------------------------------------------------------------------
34−-- | A collection of rules for the compilation process
3533data RuleSet = RuleSet
36− { -- | Routes used in the compilation structure
34+ { -- | Accumulated routes
3735 rulesRoutes :: Routes
38− , -- | Compilation rules
36+ , -- | Accumulated compilers
3937 rulesCompilers :: [(Identifier, Compiler SomeItem)]
4038 , -- | A set of the actually used files
4139 rulesResources :: Set Identifier
@@ -50,8 +48,7 @@ instance Monoid RuleSet where
5048
5149
5250--------------------------------------------------------------------------------
53−-- | Rule environment
54−data RuleEnvironment = RuleEnvironment
51+data RulesRead = RulesRead
5552 { rulesProvider :: Provider
5653 , rulesPattern :: Pattern
5754 , rulesVersion :: Maybe String
@@ -61,7 +58,7 @@ data RuleEnvironment = RuleEnvironment
6158--------------------------------------------------------------------------------
6259-- | The monad used to compose rules
6360newtype Rules a = Rules
64− { unRules :: RWST RuleEnvironment RuleSet () IO a
61+ { unRules :: RWST RulesRead RuleSet () IO a
6562 } deriving (Monad, Functor, Applicative)
6663
6764
@@ -83,7 +80,7 @@ runRules rules provider = do
8380 (_, _, ruleSet) <- runRWST (unRules rules) env ()
8481 return $ nubCompilers ruleSet
8582 where
86− env = RuleEnvironment
83+ env = RulesRead
8784 { rulesProvider = provider
8885 , rulesPattern = mempty
8986 , rulesVersion = Nothing